Is there any way to remove a CSS attribute/declaration that has already been rendered on an element? For example, if I'm using a CSS reset stylesheet to set the margin on images to 0, I can no longer use hspace or vspace valu开发者_C百科es (yes, I know they're deprecated in HTML 4+). Is there a way to remove this declaration so the browser renders the vspace and hspace correctly?
As another example, your browser permits you to change the color of links and these colors are specified in some configuration area of the browser (Tools->Options->Content->Fonts & Colors->Colors for Firefox 3.6, as an example) However, these settings only apply if no color declaration has been applied to the tag. Once you have applied a color to lnksfrom a reset stylesheet or your sitewide stylesheet, how can you remove it so the browser setting is used instead?
You can set the CSS attribute back to auto
lower down in the CSS rules:
#element {
margin: 0;
}
#element {
margin: auto;
}
I think you would have to set them back to their default values, as set by the specification: http://www.w3.org/TR/CSS2/
For color, I don't believe there is a default value set; it looks to the user agent (browser) to define that. So, once a color is set in CSS, I don't believe it can be "unset" later - you would have to manually remove that style from your reset.
精彩评论