Changes

Understanding Cascading Style Sheets (CSS)

368 bytes removed, 17:42, 17 May 2007
no edit summary
== Setting Styles using the ''id'' Attribute of an HTML Element ==
When defining an HTML tag it is possible to assign that tag an id. For example we might create a heading element with the ''mainHeadingmainText''id:
<pre>
<h1 P id="mainHeadingmainText">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 headingtext</h1>
</pre>