![]() |
|
||||||||||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|||||
|
|
#1 |
|
WLC Member
Join Date: May 2012
Posts: 3
|
Hi guys,
I discovered an interesting quirk that is causing me grief. HTML Code:
<p><span style="text-decoration: underline;">Hello <span style="text-decoration: none;">world</span>!</span></p> Much appreciated. |
|
|
|
|
|
#2 | |
|
Banned
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,197
|
Quote:
A span is an inline element, "nesting" them is not usually a "critical" requirement for a layout. Do we get to see ALL the code so we can see what other rule may be cascading to the span or may have precedence in the flow. |
|
|
|
|
|
|
#3 |
|
WLC Member
Join Date: May 2012
Posts: 3
|
I'm working with someone else's (complex) code that generates it this way. Changing the styles is easy, changing the structure that it generates is another matter. So I want to make sure there is nothing I can do CSS wise before I dive in to try to rearrange the tag structure.
This nested approach works for bold and italic, it's just underline that's the problem, even in the simplest scenario - no additional style sheets that could be interfering. HTML Code:
<html> <head></head> <body> <p><span style="font-weight: bold;">Bold <span style="font-weight: normal;">works</span>!</span></p> <p><span style="font-style: italic;">Italic <span style="font-style: normal;">works</span>!</span></p> <p><span style="text-decoration: underline;">Underline <span style="text-decoration: none;">no workies</span>!</span></p> </body> </html> |
|
|
|
|
|
#4 | |
|
Banned
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,197
|
Quote:
It's an interesting little glitch/effect and not one I have previously come across, and a couple of minutes testing shows it happens with all line type text-decoration values and in all browsers as well, which does suggest that it is intentional. Hmmm??? Calls for some investigation methinks.
|
|
|
|
|
|
|
#5 | |
|
Banned
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,197
|
Well, excellent question, mainly because I've learnt something in researching the cause.
http://www.w3.org/TR/CSS21/text.html...striking-props Quote:
|
|
|
|
|
|
|
#6 |
|
WLC Member
Join Date: May 2012
Posts: 3
|
Thanks Chris! It's good to know why this is happening, even if I can't get around it. Time for me to dive into that complex code and whip those spans into shape.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
Linear Mode |
|
|