Ivo wrote:
"macgyver" wrote
This is a strange question, and I think the answer is NO, but I am
asking anyway.
I am a member of a website which allows us to alter our member
profiles. Using css in the middle of the profile area allows one to
overide the normal formatting of the entire page and truly customize
it. But there is a span-style tag which gives an ugly blue background
to certain text which I want to get rid of. This is the tag:
<span style="background:#004D73; color:white;">
Is there anything I can do to make the browser ignore this or override
it? It is within a div-class tag named copy and using .copy I can
chage the rest of the div, but not the area within the span-style tag.
div.copy span {display:none;}
removes the span entirely while leaving the rest of div as is.
or
div.copy span {background-image:url(whitepixel.png);}
covers the blue with an image of your choice, as long as it is not
transparant. I am not sure if the shorthand "background" declaration in the
span overrides this.
Something being implied but not stated here is that the style attribute
effectively overrides the style sheet.
See
http://www.w3.org/TR/REC-CSS1#cascading-order :
5. Sort by order specified: if two rules have the same weight, the
latter specified wins. Rules in imported style sheets are considered to
be before any rules in the style sheet itself.
<snip>
A declaration in the 'STYLE' attribute of an element (see section 1.1
for an example) has the same weight as a declaration with an ID-based
selector that is specified at the end of the style sheet:
<STYLE TYPE="text/css">
#x97z { color: blue }
</STYLE>
<P ID=x97z STYLE="color: red">
In the above example, the color of the 'P' element would be red.
Although the specificity is the same for both declarations, the
declaration in the 'STYLE' attribute will override the one in the
'STYLE' element because of cascading rule number 5.
The only solution I can think of is to use Javascript to re-style the
<span>s after the document has loaded.
--
Mark.