Home  >  Article  >  Web Front-end  >  How to use css text-decoration-color property

How to use css text-decoration-color property

青灯夜游
青灯夜游Original
2019-05-29 16:21:103470browse

css The text-decoration-color property is used to set the color of text decoration (underline, overline, and underline). Note that the text-decoration-color property only works if the visible text-decoration property is first set on the element.

How to use css text-decoration-color property

How to use the css text-decoration-color property?

The text-decoration-color attribute specifies the color of text decoration (underline, overline, line-through).

Note: The text-decoration-color attribute only works on elements with a visible text-decoration attribute.

Syntax:

text-decoration-color: color|initial|inherit;

Attribute value:

● Color: Specifies the color of text modification.

● initial: Set this property to its default value.

● Inherit: Inherit this attribute from the parent element.

Note: Almost all mainstream browsers do not support the text-decoration-color attribute. Firefox supports an alternative property, the -moz-text-decoration-color property.

css text-decoration-color property example

<!DOCTYPE html>
<html>
<head>
<style>
p
{
text-decoration: underline;
text-decoration-color: red;
-moz-text-decoration-color: red; /* 针对 Firefox 的代码 */
}
</style>
</head>
<body>
<p>
线条的颜色现在应该是红色!
</p>
<p><b>注意:</b>几乎所有的主流浏览器都不支持 text-decoration-color 属性。</p>
<p><b>注意:</b>Firefox 支持另一个可替代该属性的属性,即 -moz-text-decoration-color 属性。</p>
</body>

Rendering:

How to use css text-decoration-color property

The above is the detailed content of How to use css text-decoration-color property. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn