By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,742 Members | 1,033 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,742 IT Pros & Developers. It's quick & easy.

any way to ignore span=style

P: n/a
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.
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Ivo
"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.

The only answers I can think of that do not evaluate to NO.
HTH
Ivo
Jul 20 '05 #2

P: n/a
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.
Jul 20 '05 #3

P: n/a
Mark Tranchant <ma**@tranchant.plus.com> wrote:
Something being implied but not stated here is that the style
attribute effectively overrides the style sheet.


Not quite. You can use the !important specifier.

div.copy span { background: white !important;
color: black !important; }

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.