टेक्स्ट पर उपयोग की जाने वाली सजावट के प्रकार को सेट करने के लिए, टेक्स्ट-डेकोरेशन-लाइन प्रॉपर्टी का उपयोग करें। CSS में, हमारे पास टेक्स्ट डेकोरेशन के लिए निम्नलिखित विकल्प हैं -
text-decoration-line: none|underline|overline|line-through|initial|inherit;
उदाहरण
<!DOCTYPE html>
<html>
<head>
<style>
.demo {
text-decoration: overline underline;
text-decoration-color: blue;
}
</style>
</head>
<body>
<h1>Details</h1>
<p class="demo">Examination Center near ABC College.</p>
<p class="demo2">Exam begins at 9AM.</p>
</body>
</html> आउटपुट

उदाहरण
आइए अब एक और उदाहरण देखें -
<!DOCTYPE html>
<html>
<head>
<style>
span {
text-decoration: line-through;
text-decoration-color: blue;
}
.demo2 {
text-decoration: underline;
text-decoration-color: yellow;
}
</style>
</head>
<body>
<h1>Details</h1>
<p class="demo">Examination Center near <span>XYZ College</span> ABC College.</p>
<p class="demo2">Exam begins at 11AM.</p>
</body>
</html> आउटपुट
