Home  >  Article  >  Web Front-end  >  How to write underline in css

How to write underline in css

醉折花枝作酒筹
醉折花枝作酒筹Original
2021-07-23 14:40:3727867browse

The ways to write css underline are: 1. Set through text-decoration, the syntax "text-decoration:underline"; 2. Set through border-bottom and padding.

How to write underline in css

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

Generally there are two methods:

First, set the text underline through the CSS underline code: text-decoration:underline.

The example demonstration is as follows:

1. The example code is as follows:

How to write underline in css

At this time, the page effect is as follows, with underlines appearing.

How to write underline in css

2. Achieve the effect by setting the border of the div:

The example is as follows:

Add border-bottom: 1px solid black, padding-bottom: 10px two key styles, as follows:

How to write underline in css

The page effect at this time is as follows:

How to write underline in css

Recommended learning : css video tutorial

The above is the detailed content of How to write underline 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
Previous article:What does br mean in cssNext article:What does br mean in css