相关属性:
text-indent 属性规定文本块中首行文本的缩进。
属性值:
- 
	
length 定义固定的缩进。默认值:0。
 - 
	
% 定义基于父元素宽度的百分比的缩进。
 - 
	
inherit 规定应该从父元素继承 text-indent 属性的值。
 
实现代码:
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>首行缩进</title>
		<style>
			.demo{
				width: 550px;
				height: 200px;
				margin: 50px auto;
			}
			p{
				text-indent:2em;/*em是相对单位,2em即现在一个字大小的两倍*/
			}
			}
		</style>
	</head>
	<body>
		<div class="demo">
		<p>
		这是一段测试代码,是关于CSS文本缩进的一段文字。这是一段测试代码,是关于css文本缩进的一段文字。
		这是一段测试代码,是关于css文本缩进的一段文字。这是一段测试代码,是关于css文本缩进的一段文字。
		这是一段测试代码,是关于css文本缩进的一段文字。这是一段测试代码,是关于css文本缩进的一段文字。
		</p>
		</div>
	</body>
</html>
