html 首行缩进
使用 CSS text-indent 属性。
text-indent 属性规定文本块中首行文本的缩进。
注意: 负值是允许的。如果值是负数,将第一行左缩进。
举例
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>html预览</title>
</head>
<body>
<h1>html预览</h1>
<p style="text-indent:2em;">
使用text-indent能够实现首行缩进。
举例:<p style="text-indent:2em;">。
em是长度单位,它是描述相对于应用在当前元素的字体尺寸,所以它也是相对长度单位。
2em就是在当前环境下2个字的尺寸,即一个字大小的两倍。</p>
<p style="text-indent:2em;">
a b c d e f g h i j k l m n o p q r s t u v w x y z ;
a b c d e f g h i j k l m n o p q r s t u v w x y z ;
a b c d e f g h i j k l m n o p q r s t u v w x y z ;
a b c d e f g h i j k l m n o p q r s t u v w x y z ;
a b c d e f g h i j k l m n o p q r s t u v w x y z ;
a b c d e f g h i j k l m n o p q r s t u v w x y z ;</p>
</body>
</html>