How is text text-decoration non-inherited property?

Discussion in 'CSS' started by boba5555, Feb 22, 2009.

  1. #1
    Dear,

    I have a problem with inheriting text-decoration property, and that is probably due to bad understanding specification. Actually, I have found at http://www.w3.org/TR/CSS2/text.html#propdef-text-decoration that font-decoration is not inherited, but if I use css
    i{
    	text-decoration: underline;
    }
    
    Code (markup):
    and html
    <i>test <b>one more</b></i>
    Code (markup):
    then "test one more" is the whole underlined. Shouldn't by specification only "test" be underlined, because b tag will not inherit that property? Thank you.

    The best regards,
     
    boba5555, Feb 22, 2009 IP
  2. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This means any text inside any <i> will be underlined, unless stated otherwise.
    You would have to state:
    b { text-decoration: none; } to get what you desired, or swap your <b> and <i> around
    I don't know enough about inhertiance and what not to comment on that.
     
    wd_2k6, Feb 22, 2009 IP
  3. boba5555

    boba5555 Peon

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    That is a little bit strange. i.e., if you are using display property, it is also stated that display is not inherited and actually it is not. So, if parent element is list-item, child of it doesn't have to be.

    Could someone help on this part with inherited properties?
     
    boba5555, Feb 22, 2009 IP