Jump to content

Overwriting inline attribute bgcolor?


pstein

Recommended Posts

Assume I have the following HTML code:

< table ......... bgcolor="#334455">
....
< /table>

Be aware that the bgcolor attribute is NOT placed in a separate CSS stylsheet but is embedded in the HTML code itself.

Now I want to overwrite this bgcolor by another color. The following does NOT work:

table { bgcolor: #ffffff !important; };

or

table { bgcolor=#ffffff !important; };

How else can I overwrite the color?

Peter

Link to comment
Share on other sites

The bgcolor not a css declaration property, so it will never work, the equivalent for bgcolor in CSS is the background-color: property.

 

The bgcolor attribute is not supported in html5, and it is has been advised for a long-time now, to use css background-color instead.

Edited by dsonesuk
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...