• 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-color

December 20, 2023

CSS Basics: text-decoration-color

CSS (Cascading Style Sheets) is a fundamental technology used for styling web pages. It allows web developers to control the appearance of various elements on a website. One of the CSS properties that can be used to enhance the visual presentation of text is text-decoration-color.

Understanding text-decoration-color

The text-decoration-color property is used to specify the color of the line that appears beneath or over the text when the text-decoration property is set to underline, overline, or line-through. By default, the color of the text decoration line is the same as the color of the text itself.

With the text-decoration-color property, you can customize the color of the text decoration line to match your website’s design or branding. This property works in conjunction with the text-decoration-line property, which determines the type of line to be displayed.

Usage and Syntax

The text-decoration-color property can be applied to any HTML element that supports text. It accepts a color value, such as a named color (e.g., red, blue) or a hexadecimal color code (e.g., #FF0000, #0000FF).

The syntax for using the text-decoration-color property is as follows:

selector {
  text-decoration-color: value;
}

Here, selector refers to the HTML element(s) to which you want to apply the property, and value represents the desired color for the text decoration line.

Examples

Let’s consider a few examples to illustrate the usage of the text-decoration-color property:

/* Example 1: Using a named color */
a {
  text-decoration: underline;
  text-decoration-color: red;
}

/* Example 2: Using a hexadecimal color code */
h1 {
  text-decoration: line-through;
  text-decoration-color: #0000FF;
}

In the first example, the text-decoration-color property is used to set the color of the underline for all anchor (a) elements to red. This creates a consistent visual style for hyperlinks throughout the website.

In the second example, the text-decoration-color property is applied to an h1 heading element. It sets the color of the line-through decoration to blue (#0000FF), giving a strikethrough effect to the heading text.

Summary

The text-decoration-color property in CSS allows web developers to customize the color of the text decoration line, such as underline, overline, or line-through. By using this property, you can create visually appealing and consistent designs for your website’s text elements.

If you are interested in learning more about VPS hosting solutions, consider exploring Server.HK. With their top-notch VPS services, you can ensure reliable and high-performance hosting for your website.

Recent Posts

  • How to Configure FirewallD in CentOS Stream: From Essential to Production-Grade
  • Installing Docker on CentOS: A Practical Setup Guide (CentOS Stream 9/10 – 2026)
  • How to Secure a CentOS Server: 15 Essential Hardening Techniques (CentOS Stream 9/10 – 2026)
  • CentOS End of Life (EOL): What It Means and Migration Options in 2026
  • How to Configure a LAMP Stack on CentOS Stream for Production

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