CSS Text Decoration Property
|CSS text property is used to add decoration to text. It is different from text font, color etc.
CSS text decoration property supports 5 values –
none
, which removes any decorationunderline
, which draws a 1px line across the text at the baselineline-through
, which draws a 1px line across the text at the text’s “middle” pointoverline
, which draws a 1px line across the text at the text’s “top” pointblink
, a much-maligned property that causes the text to flash, alternating between 0 and 100% opacity
Some other text decoration properties and effect in the following table –
text-decoration | Overline | p{ text-decoration: overline; } | Gives text with overline |
text-decoration | Underline | p{ text-decoration: underline; } | Gives text with underline |
text-decoration | None | p{ text-decoration: none; } | Gives text with nolines |
text-indent | px | p{ text-indent: 30px; } | Gives text with a 30px indent |
text-indent | % | p{ text-indent: 30%; } | Gives text with a 30% indent |
text-align | right | p{ text-align: right; } | Right-aligns text |
text-align | Left | p{ text-align: left; } | Left-aligns text |
text-align | justify | p{ text-align: justify; } | Justifies text |
text-transform | capitalize | p{ text-transform: capitalize; } | Gives text in capitals |
text-transform | uppercase | p{ text-transform: uppercase; } | Gives text in uppercase |
text-transform | lowercase | p{ text-transform: lowercase; } | Gives text in lowercase |
word-spacing | Px | p{ word-spacing: 10px; } | Gives a wordspacing of 10px |
letter-spacing | Px | p{ letter-spacing: 3 px; } | Gives a wordspacing of 3px |