AlfieWebDevTips Homefor new and experienced developers
[Home Home] [Web Development Web Development ] [Code Generators Code Generators ] [Resources Resources ] [Contact Us Contact ] |WebDevTips Privacy Privacy |
Print This Page

You are here : Home - Web Development - Style Sheets - Guide - Advanced Styles (cont)

Advanced Styles (cont)



We now have our table and our styles defined, now to apply the styles. We are going to do this by applying the classes to the appropriate table cells.

Here's what our table code should look like now

<table width="200" border="1" align="center"> 
<tr> 
    <td class="myheading">heading</td> 
    <td class="myheading">heading</td> 
    <td class="myheading">heading</td> 
</tr> 
<tr> 
    <td class="mydata">data</td> 
    <td class="mydata">data</td> 
    <td class="mydata">data</td> 
</tr> 
</table>

And our table with the styles applied.

heading heading heading
data data data

You'll notice that we applied our classes by using the class="CLASSNAME" in the <td> tag like <td class="myheading">heading</td>

Ok so you could have done that with html font tags and bgcolors etc but by creating classes we can reuse them whenever we want.
For example
I am some text with the myheading style applied
and I am some text with the mydata style applied
I am some text with one of this sites classes applied

You should get the idea now (I hope). Careful planning is the key to success, look for elements in your design where you could apply a style (even if you don't think you'll need it at that time) plan ahead.

Look out for tips on CSS and also check the FAQ for other useful answers.

Well that lot should keep you busy for a while :) I hope you found this guide to style sheets interesting and useful and as always we would love to hear what you think so please get in touch with your comments.



Why not discuss this article in our forum?






Google
 

[back to top of page]   

[labelled with icra -  - this link will open in a new window] [RSS Content]

[Copyright © WebDevTips]