Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<td bgcolor=the color from css>

Status
Not open for further replies.

welldefined

Programmer
Mar 9, 2006
62
0
0
GB
Hi,

How to set a color (css?) so that I can use it in my pages for a few <td bgcolor=...> (not all)

Thank you in advance.
 
Use a class. Put this in the HEAD section of your page:

Code:
<style type="text/css">
   .colouredCell {
      background-color: gold;
   }
</style>

and then use the "colouredCell" on your cells:

Code:
<td class="colouredCell">...</td>

Hope this helps,
Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
It is better to have a file with your class info, in this case genstyle.css.

Then define a class colouredCell in your .css file.
Reason being is that if you want to make changes, then just modify you .css file, and not have to change all your that refer to colouredCell.

<link rel="stylesheet" type="text/css" href="genstyle.css">
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top