views:

60

answers:

4

There is a markup:

<a href="#">
    lorem ipsum<span>15</span>
</a>

There are styles:

a{
    text-decoration: underline;
}

a span{
    background: #fff;  //To clean the bottom underlining under <span>
}

Works in all interesting me browsers. Except IE6. The bottom underlining under <span> remains.

How to solve this problem without changing a markup.


a span{
    text-decoration: none;
}

Does not work.

+1  A: 

why don't you try?

a span{
    background: none;
    text-decoration: none;
}

I believe this works for all browsers?


Try adding background: none; to the existing CSS tag as shown above. I'll try and see if I can't get this to work on IE6.

The Elite Gentleman
Wrote even so: `text-decoration:none !important;` Does not work in IE6. Underlining does not disappear.
Kalinin
A: 

Might this work?

a{
    text-decoration: underline;
}

a span{
    background: #fff;  //To clean the bottom underlining under <span>
    text-decoration: none;
}
spender
Wrote even so: `text-decoration:none !important;` Does not work in IE6. Underlining does not disappear.
Kalinin
A: 

To add to Elite Gentleman's answer: Use a conditional statement (prefered) or the underscore hack for targeting IE6 only:

a span {
  _text-decoration: none;
}
Boldewyn
@Boldewyn, But it does not change an essence. `text-decoration:none;` not works.
Kalinin
Do you have any side effects? IDs, background images, inline style declarations? Can you be sure, that it is an IE bug and not something inherited from somewhere else?
Boldewyn
@Boldewyn, my styles works in: firefox 3.6.2, Chrome 5.0. Not works in: ie6, ie7, opera 10.0.
Kalinin
IE7? That's strange? What DOCTYPE are you using?
The Elite Gentleman
@The Elite Gentleman, XHTML 1.0 Transitional
Kalinin
+3  A: 

Try changing your CSS to this:

a span {
    background: #fff;
    display: inline-block;
}

Despite what others have posted, text-decoration: none; does NOT work.

Marlorn
@Marlorn, Underlining does not disappear.
Kalinin
I take back my comment about `text-decoration: none;` not working. Add it in and I believe it works.
Marlorn
@Marlorn, It does not work for me. I do not know why. There can be any styles disturb.
Kalinin
I've tested this as well. For me, `background` + `display` makes it work in everything but IE6, and `text-decoration` makes it work in IE6.
mercator