...

View Full Version : override table bgcolor using css?



Errica
08-27-2008, 07:51 AM
I cannot edit the bgcolor. Further, I don't see how the info here (http://www.standardsforlife.com/override-inline-styles-from-the-stylesheet/) will work.

Can the bg color below be changed using css at the end of the document?

<table width="982" bgcolor="#e5e0d4" border="0" cellpadding="4" cellspacing="0">

_Aerospace_Eng_
08-27-2008, 08:21 AM
You aren't reading the info correctly.

table {
background-color:#F00 !important;
}
Though I don't know if IE 6 supports that but pretty IE7 and IE8 do. You could even do this

table[width="982"] { /* not supported in IE 6 */
background-color:#F00 !important;
}

Errica
08-27-2008, 08:51 AM
Doesn't seem to work in ff3. Can I msg you to send the url? Would it matter is the css is after the bgcolor parameter?

_Aerospace_Eng_
08-28-2008, 01:43 PM
I guess you can send me the url but I don't understand, why can't you edit the html?

Eli.
08-28-2008, 02:57 PM
I cannot edit the bgcolor. Further, I don't see how the info here (http://www.standardsforlife.com/override-inline-styles-from-the-stylesheet/) will work.

Can the bg color below be changed using css at the end of the document?

<table width="982" bgcolor="#e5e0d4" border="0" cellpadding="4" cellspacing="0">

As far as I know;
a. It is not possible to override any inline styling (especially HTML styling, and not CSS) using css that is not inline. inline style is at the highest priority.
b. tables background color cannot be overriden if set. i.e. if you have bgcolor="something" than it is not possible to override it.

You could however use javascript, but that seems overkill for a color change.

Eli.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum