• Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
logo logo
  • Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
ENEN
  • 简体简体
  • 繁體繁體
Client Area

Css Basic: text-decoration

December 20, 2023

CSS Basics: text-decoration

Cascading Style Sheets (CSS) is a fundamental technology used to style and format web pages. It provides a wide range of properties and values that allow developers to customize the appearance of HTML elements. One such property is text-decoration, which is used to add visual effects to text. In this article, we will explore the various options available with the text-decoration property and how they can be used to enhance the design of your website.

Underline

The most common use of the text-decoration property is to add an underline to text. This is achieved by setting the value of text-decoration to underline. For example:

p {
  text-decoration: underline;
}

This will apply an underline to all paragraphs on your web page. You can also apply the underline to specific elements by using their respective selectors.

Line-through

In addition to underlining, you can also strike through text using the text-decoration property. This is commonly used to indicate deleted or outdated content. To apply a line-through effect, set the value of text-decoration to line-through. For example:

del {
  text-decoration: line-through;
}

This will apply a line-through effect to all <del> elements on your web page.

Overline

The text-decoration property can also be used to add an overline effect to text. This places a line above the text, similar to an underline but at the top. To apply an overline effect, set the value of text-decoration to overline. For example:

h1 {
  text-decoration: overline;
}

This will add an overline effect to all <h1> elements on your web page.

Blink

Another interesting effect that can be achieved with the text-decoration property is the blink effect. This makes the text flash on and off, creating a blinking effect. To apply the blink effect, set the value of text-decoration to blink. For example:

.highlight {
  text-decoration: blink;
}

This will make all elements with the class highlight blink on your web page. However, it’s important to note that the blink effect is not supported in all browsers and may not be recommended for use due to its potential to cause accessibility issues.

Combining Effects

The text-decoration property also allows you to combine multiple effects. For example, you can underline and strike through text simultaneously by using the value underline line-through. Similarly, you can combine any combination of underline, line-through, overline, and blink to achieve the desired effect.

It’s worth noting that the text-decoration property can be inherited by child elements. If you want to remove the text decoration from a specific element, you can set its value to none. For example:

a {
  text-decoration: none;
}

This will remove any text decoration from all <a> elements on your web page.

Conclusion

The text-decoration property in CSS provides a range of options to enhance the visual appearance of text on your web page. Whether you want to underline, strike through, overline, or even blink text, the text-decoration property allows you to achieve these effects easily. Experiment with different combinations to find the style that best suits your website’s design.

For more information on CSS and web hosting services, consider exploring Server.HK, a leading VPS hosting company that offers reliable and high-performance hosting solutions.

Recent Posts

  • How to Deploy a Node.js Application on Hong Kong VPS: Complete Guide
  • How to Set Up a WordPress Site on a Hong Kong VPS with aaPanel (Step-by-Step 2026)
  • How to Choose the Right Hong Kong VPS Plan: A Buyer’s Guide for 2026
  • CN2 GIA vs BGP vs CN2 GT: What’s the Real Difference for China Connectivity?
  • Top 5 Use Cases for a Hong Kong Dedicated Server in 2026

Recent Comments

No comments to show.

Knowledge Base

Access detailed guides, tutorials, and resources.

Live Chat

Get instant help 24/7 from our support team.

Send Ticket

Our team typically responds within 10 minutes.

logo
Alipay Cc-paypal Cc-stripe Cc-visa Cc-mastercard Bitcoin
Cloud VPS
  • Hong Kong VPS
  • US VPS
Dedicated Servers
  • Hong Kong Servers
  • US Servers
  • Singapore Servers
  • Japan Servers
More
  • Contact Us
  • Blog
  • Legal
© 2026 Server.HK | Hosting Limited, Hong Kong | Company Registration No. 77008912
Telegram
Telegram @ServerHKBot