Fork me on GitHub

首行缩进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>
posted @ 2017-09-27 15:38  思考的大腿  阅读(1253)  评论(0编辑  收藏  举报