34,333
edits
Changes
→Creating CSS Rules
== Creating CSS Rules ==
Each element of a style sheet is known as a ''rule''. To create a rule simply specify the HTML tag that is to be modified by the style (such as the <H1> tag in the above example, followed by a list of properties and settings contained in braces.
For example to change the font style setting of the <p> tag simply write the following rule:
<pre>
P { font-style: italic; }
</pre>
It is also possible to specify more than one property per rule by using ; separators:
<pre>
P { font-style: italic; color: green }
</pre>
and it is also common to apply a single rule to multiple HTML tags by comman separating them:
<pre>
P, H1, H2, H3 { font-style: italic; color: green }
</pre>