how to get inside the html tag in the first line indent two spaces?

We do when the inevitable page to use <p>the label to write a paragraph, but with a <p>label usually write paragraphs and paragraphs of the article we see are not the same, the first two lines no blank cells. what can we do about it?
This requires the use cssof the text-indentproperty. text-indentSo that the container can be the first line indent certain units. For example, Chinese general paragraphs of each segment before empty two characters.

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>段落缩进</title>
<style>
    .p1{text-indent: 40px;}
    .p2{text-indent: 3em;}
</style>
</head>
<body>
    <p class="p1">斯蒂芬·库里(Stephen Curry),1988年3月14日出生于美国俄亥俄州阿克伦(Akron,Ohio),美国职业篮球运动员,司职控球后卫,效力于NBA金州勇士队。</p>
    <p class="p2">斯蒂芬·库里于2009年通过选秀进入NBA后一直效力于勇士队,新秀赛季入选最佳新秀第一阵容;2014-15、2016-17、2017-18赛季三次随勇士队获得NBA总冠军;两次当选常规赛MVP,两次入选最佳阵容第一阵容,5次入选全明星赛西部首发阵容。</p>
</body>
</html>

Results are as follows: Here Insert Picture Description
Note:
1. Here we need to understand a unit of length em. em is the relative length unit. Text objects relative to the current font size. I wrote 3em is actually indented by the length of three characters.
2. Allow the use of a negative value. If you use a negative value, then the first line will be indented to the left.

Published 15 original articles · won praise 26 · views 7685

Guess you like

Origin blog.csdn.net/Big_eyes123/article/details/84257490