CSS Text Decoration Style Explained
CSS Text Decoration Style Explained
CSS Text Decoration Style Explained
text-decoration-style property in css defines the pattern or design of text-decoration line
Why is Important
- Creative link styles
- Highlighted text
- Error indicators
- Better UI effects
How It Works Internally
Real World Use
- Custom link styling
- Highlight important words
- Education websites
- Error message indication
- ModernUI design
Advantages
- Improves design
- Adds creativity
- Better user experience
- Easy to implement
- Works in modern browsers
Syntax :
CSS Text Decoration Style Explained
Examples
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
text-decoration: overline;
}
h2 {
}
h3 {
text-decoration: underline;
}
h4 {
text-decoration: underline overline;
}
</style>
</head>
<body>
<h1> CSS Text Decoration Style Explained</h1>
<h2>CSS Text Decoration Style Explained</h2>
<h3>CSS Text Decoration Style Explained</h3>
</body>
</html>
CSS Text Decoration Style Explained
<!Doctype html> → browser this is an HTML document
<html> → Root element of the webpage
<head> → Contains metadata and CSS style
<style> → Internal CSS is written
Step 2]
<style> tag Internal CSS Section
h1 {
text-decoration: overline;
}
h2 {
text-decoration: line-through;
}
h3 {
text-decoration: underline;
}
h4 {
text-decoration: underline overline;
}
</style>
<h1> selector
- text-decoration:overline;
- adds line above text.
<h2> selector
- line-through add line through the middle of text.
h2 {
text-decoration: line-through;
}
output
h3 selector
- adds line below text.
- very commonly use for links.
css code
h3 {
text-decoration: underline;
}
Output
CSS Text Decoration Style Explained
h4 selector
- Combines two values
- adds both underline and overline to the text.
h4 {
text-decoration: underline overline;
}
Output
Step 6]
<body> section
<body>
<h1> CSS Text Decoration Style Explained</h1>
<h2>CSS Text Decoration Style Explained</h2>
<h3>CSS Text Decoration Style Explained</h3>
<h4>https://webdesigningtheory.blogspot.com</h4>
- h1 → overline
- h2 → line-through
- h3 → underline
- h4 → underline + overline
Step 7]
closing the Tag
</body> </html>
CSS Text Decoration Style Explained
Output
Related Post :-
Comments
Post a Comment