How to indent html

藏色散人
Release: 2023-01-06 11:12:46
Original
18468 people have browsed it

html Method to achieve indentation effect: First create an HTML sample file; then enter some text content in the body; finally specify the indentation of the first line of text in the text block through the "text-indent" attribute .

How to indent html

The operating environment of this article: windows7 system, HTML5&&CSS3 version, DELL G3 computer

How to indent html?

First of all, we need to understand the attribute text-indent. This label is used to indent the first line. Its unit is the length unit or percentage.

The text-indent attribute specifies the first line in the text block. The indentation of the text.

Note: Negative values ​​are allowed. If a negative value is used, the first line will be indented to the left.

Note: Before CSS 2.1, text-indent always inherited a calculated value, rather than a declared value.

Example:

<html>
<head>
<style type="text/css">
p {text-indent: 1cm}
</style>
</head>

<body>
<p>
这是段落中的一些文本。
这是段落中的一些文本。
这是段落中的一些文本。
这是段落中的一些文本。
这是段落中的一些文本。
这是段落中的一些文本。
这是段落中的一些文本。
这是段落中的一些文本。
这是段落中的一些文本。
这是段落中的一些文本。
这是段落中的一些文本。
这是段落中的一些文本。
</p>
</body>

</html>
Copy after login

Effect:

How to indent html

##Recommended study: "

HTML video tutorial

The above is the detailed content of How to indent 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
Popular Tutorials
More>
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!