text-decoration - CSS | text-decoration
Textdecorationsaredrawnacrossdescendanttextelements.Thismeansthatifanelementspecifiesatextdecoration,thenachildelementcantremovethedecoration.Forexample,inthemarkup
Thistexthassomeemphasizedwordsinit.
,thestylerulep{text-decoration:underline;}wouldcausetheentireparagraphtobeunderlined.Thestyleruleem{text-decoration:none;}wouldnotcauseanychange;theentireparagraphwouldstillbeunderlined.However,theruleem{text-decoration:overline;}wouldcauseaseconddecoration...Text decorations are drawn across descendant text elements. This means that if an element specifies a text decoration, then a child element cant remove the decoration. For example, in the markup <p>This text has <em>some emphasized words</em> in it.</p>, the style rule p { text-decoration: underline; } would cause the entire paragraph to be underlined. The style rule em { text-decoration: none; } would not cause any change; the entire paragraph would still be underlined. However, the rule em { text-decoration: overline; } would cause a second decoration to appear on "some emphasized words".