Cascading Style Sheets and Table Backgrounds
I am working on a new design for my website and need some help with a problem I have run into. I want to change the background color of a specific table on my website using a cascading style sheet. The only thing I can figure out how to do right now is change the background color for all of the tables. Does anyone know if it is possible to change the background colors of individual tables using cascading style sheets and if it is possible how? Thanks in advance.
Norge
Norge
0
Comments
In your CSS file put:
table.default, td.default { border-style:solid; border-width:1; border-color:#0055FF; background-color:#DDFFFF; }(replace default with anything you want)
Then when using the table tag just put class="default"
In this case it would work for td as well as I added it after default.
This works with any tag. Makes it easy to make up a site layout and change the colors globally. You can actually have multiple css files with different color/font schemes and have users select the one they want and it would be called via php and a cookie (or IP). I'm thinking of doing this for my next layout. Some people like my current layout, some people find it's to bright etc... so giving choice would be cool. My next layout will probably be more like my forum but better.
Good luck with the redesign
edit: oops did not know html was enabled directly on this forum, had messed up the layout with that table example. Fixed it now.
Norge