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

How to write underline in css

醉折花枝作酒筹
Release: 2023-01-07 11:45:28
Original
27961 people have browsed it

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!

Related labels:
css
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template