टेक्स्ट पर उपयोग की जाने वाली सजावट का प्रकार सेट करने के लिए text-decoration-line प्रॉपर्टी का उपयोग करें। 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>विवरण</h1>
<p class="demo">परीक्षा केंद्र ABC कॉलेज के पास।</p>
<p class="demo2">परीक्षा सुबह 9 बजे शुरू होती है।</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>विवरण</h1>
<p class="demo">परीक्षा केंद्र <span>XYZ कॉलेज</span> ABC कॉलेज के पास।</p>
<p class="demo2">परीक्षा सुबह 11 बजे शुरू होती है।</p>
</body>
</html>
आउटपुट

व्याख्या: text-decoration-line सजावट का प्रकार सेट करता है: underline (नीचे), overline (ऊपर), line-through (बीच में काटता हुआ)। एकाधिक मान स्पेस से अलग करके जोड़े जा सकते हैं। text-decoration शॉर्टहैंड लाइन, रंग, शैली, मोटाई सेट करता है।