CSS text-decoration property cannot be overridden by child element [duplicate]

From the text-decoration spec:

The ‘text-decoration’ property on descendant elements cannot have any effect on the decoration of the ancestor.

The answer in the linked question further quotes (I can’t find this text in the spec anymore however):

Text decorations on inline boxes are drawn across the entire element, going across any descendant elements without paying any attention to their presence.

And another quote, CSS3 seems to introduce text-decoration-skip, intended to address this by applying the property on the descendant (in your case, <span>):

This property specifies what parts of the element’s content any text decoration affecting the element must skip over. It controls all text decoration lines drawn by the element and also any text decoration lines drawn by its ancestors.

Leave a Comment