in , ,

CSS Text Decoration

CSS Text Decoration
CSS Text Decoration

CSS Text Decoration

CSS Text Decoration: The text-decoration property is used to add “decorations” to inline content.

Text Decoration

The text-decoration property is used to set or remove decorations from text.

The value text-decoration: none; is often used to remove underlines from links:

Example

<!DOCTYPE html>
<html>
<head>
<style>
a {
  text-decoration: none;
}
</style>
</head>
<body>

<p>A link with no underline: <a href="https://www.worldofitech.com/</a></p>

</body>
</html>

The other text-decoration values are used to decorate text:

Example

<!DOCTYPE html>
<html>
<head>
<style>
h1 {
  text-decoration: overline;
}

h2 {
  text-decoration: line-through;
}

h3 {
  text-decoration: underline;
}
</style>
</head>
<body>

<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>

</body>
</html>

Note: It isn’t prescribed to underline text that isn’t a link, as this often confuses the reader.


Thanks for reading! We hope you found this tutorial helpful and we would love to hear your feedback in the Comments section below. And show us what you’ve learned by sharing your projects with us.

salman khan

Written by worldofitech

Leave a Reply

How to View Saved Wi-Fi Passwords on Android

How to View Saved Wi-Fi Passwords on Android

CSS Text Transformation

CSS Text Transformation