首行缩进css

html首行缩进2字符,可以使用CSS属性中的【text-indent】进行设置。

设置代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>缩进2字符</title>
<style type="text/css">
p{ text-indent:2em;}
</style>
</head>
<body>
<p>首行缩进2字符的案例展示如下。需要多写几行看效果,需要多写几行看效果,需要多写几行看效果,需要多写几行看效果,需要多写几行看效果,需要多写几行看效果,需要多写几行看效果。</p>
</body>
</html>
原文地址:https://www.cnblogs.com/thinkingthigh/p/7602041.html