text-decoration
allows certain text effects such as underlining.
Item | Value |
---|---|
Initial value | none |
Inherited | No. |
Version | CSS1 |
JavaScript syntax | object.style.textDecoration="overline" |
Applies to | All elements. |
text-decoration: blink | inherit | line-through | none | overline | underline
The property values are listed in the following table.
Value | Description |
---|---|
none | a normal text. This is default |
underline | a line below the text |
overline | a line above the text |
line-through | a line through the text |
blink | a blinking text. |
inherit | inherit the text-decoration property from the parent element |
text-decoration |
Yes | Yes | Yes | Yes | Yes |
An example showing how to use text-decoration CSS property.
<!DOCTYPE HTML>
<html>
<head>
<style>
a:link, a:visited, a:hover, a:active {
text-decoration: underline;<!-- www .j ava 2s .c o m-->
color: #6A5ACD;
background-color: transparent;
}
</style>
</head>
<body>
<ul>
<li><a href="#">A</a></li>
<li><a href="#">B</a></li>
<li><a href="#">C</a></li>
<li><a href="#">D</a></li>
</ul>
</body>
</html>