CSS Property: text-decoration-style
[this page | pdf | back links]
The CSS (CSS3) text-decoration-style
property indicates the style of any line in any visible text decoration added
to a given piece of text. For this property to have an effect, a visible text-decoration
needs to have been applied to the text.
Valid property values
(other than inherit
and initial) are:
Value
|
Description
|
dashed
|
Text decoration
displays as a dashed line
|
dotted
|
Text decoration
displays as a dotted line
|
double
|
Text decoration
displays as a double line
|
solid
|
(default value). Text
decoration displays as a single line
|
wavy
|
Text decoration
displays as a wavy line
|
Default Value:
|
solid
|
JavaScript syntax:
|
e.g. object.style.textDecorationStyle="dotted"
|
Inherited:
|
No
|
Animatable:
|
No
|
EXAMPLE:
HTML USED IN THIS EXAMPLE:
<!DOCTYPE html>
<html> <!-- Copyright (c) Nematrian Limited 2018 -->
<head>
<style>
div {width: 200px; text-decoration: overline;}
.x1 {text-decoration-style: wavy}
</style>
</head>
<body>
Note: not all browsers support this style<br><br>
1. Element with default property<br><br>
<div><span>abcde</span></div><br><br>
2. Element set using in-file HTML style<br><br>
<div><span class="x1">abcde</span></div><br><br>
3. Element set using JavaScript<br><br>
<div><span id="x2">abcde</span></div>
<script>
document.getElementById("x2").style.textDecorationStyle = "wavy";
</script>
</body>
</html>
|
FUNCTION THAT MAY ASSIST IN TESTING WHETHER FEATURE IS SUPPORTED:
function isSupportedCSSPropertyTextDecorationStyle() {
var x = document.createElement("DIV"); x.style.textDecorationStyle = "dotted"; return (window.getComputedStyle(x, null).textDecorationStyle == "dotted");
} |
NAVIGATION LINKS
Contents | Prev | Next | CSS Properties