Changes

Jump to: navigation, search

Understanding Cascading Style Sheets (CSS)

645 bytes added, 17:27, 17 May 2007
Setting Styles Indiviual Elements
<pre>
<h1 style="color: red;">This is a test heading</h1>
</pre>
 
== Setting Styles using the ''id'' Attribute of an HTMl Element ==
 
When defining an HTML tag it is possible to asdsign that tag an id. For example we might create a heading element with the ''mainHeading'':
 
<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 any tag that has the matching id will inherit the style for that id.
 
== Setting up Styles usingf Classes ==
 
== Setting Styles using the ''id'' Attribute of an HTMl Element ==

Navigation menu