Changes

Understanding Cascading Style Sheets (CSS)

361 bytes added, 17:41, 17 May 2007
Setting Styles using the ''id'' Attribute of an HTML Element
<pre>
<h1 id="mainHeading">This is the main heading</h1>
</pre>
 
having defined the ''id'' we can now create a CSS rule specifically for this element ''id'' by prefixing the id with a ''#'' character:
 
<pre>
#mainHeading {color: blue; font-style: normal}
</pre>
 
Now the tag that has the matching id will inherit the style for that id.
 
== Using Classes with CSS ==
 
<h1 id="mainHeading">This is the main heading</h1>
</pre>