डिफ़ॉल्ट रूप से, HTML में सभी लिंक एक अंडरलाइन से सजाए जाते हैं। हम CSS टेक्स्ट-डेकोरेशन प्रॉपर्टी का उपयोग करके इस अंडरलाइन को हटा सकते हैं।
सिंटैक्स
CSS टेक्स्ट-डेकोरेशन प्रॉपर्टी का सिंटैक्स इस प्रकार है -
Selector {
text-decoration: /*value*/
} उदाहरण
निम्नलिखित उदाहरण CSS टेक्स्ट-डेकोरेशन प्रॉपर्टी को दर्शाते हैं।
<!DOCTYPE html>
<html>
<head>
<style>
p {
padding: 5px;
box-shadow: inset 0 0 5px violet;
}
a {
font-style: italic;
text-decoration: none;
}
</style>
</head>
<body>
<a href="#">Demo</a>
<p>
<a href="https://example.com/">Example domain</a>
</p>
</body>
</html> आउटपुट
यह निम्न आउटपुट देता है -

उदाहरण
<!DOCTYPE html>
<html>
<head>
<style>
div {
margin: auto;
width: 50%;
text-align: right;
color: green;
border: thin dashed red;
}
a {
text-decoration: none;
}
a:last-child {
color: inherit;
background-color: moccasin;
}
</style>
</head>
<body>
<div>
<a href="#">Link Demo</a>
<p>
Watch this: <a href="https://example.com/">Example site</a>
</p>
</div>
</body>
</html> आउटपुट
यह निम्न आउटपुट देता है -
