How do I get this CSS text-decoration override to work?

前端 未结 6 2293
生来不讨喜
生来不讨喜 2020-11-22 11:49

Some days I swear I\'m going mad. This is one of those days. I thought my CSS was fairly straight-forward here, but it just doesn\'t seem to be working. What am I missing?

6条回答
  •  青春惊慌失措
    2020-11-22 11:59

    text-decoration does not behave the same as other font/text related styling like font-weight. Applying text-decoration will affect all nested elements as well.

    Check this out: http://www.w3.org/TR/CSS21/text.html#propdef-text-decoration

    Excerpt:

    Text decorations on inline boxes are drawn across the entire element, going across any descendant elements without paying any attention to their presence. The 'text-decoration' property on descendant elements cannot have any effect on the decoration of the element
    . . . .
    Some user agents have implemented text-decoration by propagating the decoration to the descendant elements as opposed to simply drawing the decoration through the elements as described above. This was arguably allowed by the looser wording in CSS2.

    I've got the info from: http://csscreator.com/node/14951

提交回复
热议问题