View Full Version : Need Help with CSS

07-04-2009, 07:59 PM
I have 5 forms and I want to apply these settings(background-color:#006666; font-family: 'Arial Black'; height: 6px; font-size: small;color: #ffffff) using css to a heading in all those 5 forms. How can I achieve this? I am using a separte CSS file.

My heading HTML is 1 form is

<td>Status Information</td>
Can someone please help me with that?


07-05-2009, 05:14 PM
Since you have multiple (five) elements that you wish to style the same way, you should declare a "class" identification in your markup like so:
<td class="class_name">Status Information</td>

Then in your CSS file you need to define the style like so:
.class_name{background:#006666;color:#FFFFFF;font-family:"Arial Black",Verdana,Sans-serif};font-size:small;height:6px;}
with the font-family, always start with the one you want but always define alternatives.

07-06-2009, 10:42 AM
Hello :)

I also wanted to suggest that if these are the titles of your table, you use the table heading - <th> - tag instead of <td> - it's very handy for people using assistive technology :)

07-06-2009, 09:07 PM
It's largely my own personal preference, but I always wrap the text inside a table inside its own <p> tag (or appropriate level heading <h#> for td cells), so that I can style the text separately from the containing cell.

You don't mention the context for the <th> cells - do they appear in separate divs, or do the tables they appear within each have an ID? Do you have other td cells that you want to appear differently styled? All of these could lead to different approaches to how you could use the CSS.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum