How to indent the first line of html

藏色散人
Release: 2023-01-05 16:14:25
Original
22207 people have browsed it

How to indent the first line of html: First create two p tags in the page; then add the text-indent attribute to the p tag; finally set the attribute value to 2em to achieve the first line indentation effect.

How to indent the first line of html

The operating environment of this article: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.

html paragraph first line indentation

The specific steps are as follows:

First create two p tags in the page, in the p tag Add a piece of text. In order to easily see the effect, set the length of the p tag to 300px, as shown in the figure below.

How to indent the first line of html

Then add the text-indent attribute to the p tag and set the attribute value to 2em. Em is a relative unit. 2em means twice the current size of a text, also Just two characters.

How to indent the first line of html

In this way, the first line is indented, and the effect is as shown below.

How to indent the first line of html

Recommended study: "HTML Video Tutorial"

The above is the detailed content of How to indent the first line of html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!