Home >Web Front-end >CSS Tutorial >How to set underline to dotted line in css

How to set underline to dotted line in css

王林
王林Original
2020-11-18 11:19:308056browse

How to set the underline to dotted line in css: You can use the text-decoration-style attribute to set it, such as [text-decoration-style: dotted;]. The text-decoration-style attribute is used to specify how lines are displayed.

How to set underline to dotted line in css

Related properties:

text-decoration-style property specifies how lines are displayed.

(Learning video sharing: css video tutorial)

Grammar:

text-decoration-style: solid|double|dotted|dashed|wavy|initial|inherit;

Attribute value:

  • solid Default value. The line will appear as a single line.

  • double The lines will be displayed as double lines.

  • dotted The lines will appear as dotted lines.

  • dashed The lines will appear as dashed lines.

  • wavy Lines will appear as wavy lines.

  • initial Set this property to its default value.

  • inherit Inherit this attribute from the parent element.

Example:

Add a dotted underline to the a tag

<a href="#">css如何设置下划线虚线</a>

//css
a{
    text-decoration-style: dotted;
}

Related recommendations: CSS tutorial

The above is the detailed content of How to set underline to dotted line in css. 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