It is used to add decoration to text.
Syntax -
text-decoration : text-decoration-line text-decoration-color text-decoration-style text-decoration-thickness ;
Note: We can modify text decoration color,thickness,line,style separately, which we learn in next topics.
values
It is use to set the text decoration like type like underline, overline, line-through |
|
text-decoration-color | It is use to set the text decoration color |
text-decoration-style | It is use to set the text decoration style like solid, wavy, dotted, dashed, double |
text-decoration-thickness |
It is use to set the text decoration thickness |
For example -
<!DOCTYPE html>
<html>
<head>
<title>CSS Text Decoration</title>
<style>
h1 {
text-decoration: underline overline red dotted;
}
h2 {
text-decoration: underline wavy blue 5px;
}
</style>
</head>
<body>
<h1>Welcome to teknowize 1</h1>
<h2>Welcome to teknowize 2</h2>
</body>
</html>
Output