CSS text decoration line is used to define the type of line for text decoration.
Syntax
1 |
text-decoration-line: enter value for decoration |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<style> h2{ text-decoration-line:underline; } .div-align{ text-align:justify; text-align-end:right; border:1px solid yellow; border-radius:20px; padding:10px; } </style> <h2>This is the heading</h2> <div class="div-align"> <p>This is a paragraph to show text decoration property.</p> </div> </body> </html> |
Output
This is the heading
This is a paragraph to show text decoration property.
CSS text decoration line values list
Sr. No. | value | Description |
---|---|---|
1 | none | Used to define the no decoration of the text. The value for this is none. |
2 | underline | Used to make the text underline. The value for this is underline. |
3 | overline | Used to make the text appear line over it. The value for this is overline. |
4 | line-through | Used to make the text to appear like deleted text. The value for this is line-through. |
5 | initial | Used to define as the property initial value. |
6 | inherit | Used to define the computed value of property on the elements parent. |
7 | unset | Used to define the property either acts as inherit or initial, depending on the property if it is inherited or not. |