Constructing Style Rules
An embedded style sheet consists of a two-sided <style> tag placed in the <head> section of a document. Between the <head> and </head> tags, you define the rules for the various styles.
A style rule begins with the name of the tag or other element to which the style
applies. For example, if you are creating a rule that will apply to all instances of
the <h1> tag, start the rule with h1 (no brackets):
<style> h1 </style>
Next, type a set of curly braces. You can place them on separate lines for greater readability if you want. Then place the rule inside the braces. For example, to create a rule that makes the text of a first-level heading red:
<style> h1 { color: red } </style>
If you have more than one rule to apply, such as ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access