ITeye博客

第6章 文本属性==>文本缩进 P135

conkeyn · 2009-05-24 19:55 · CSS · HTML · CSS · XHTML · Markdown

通过使用text-index属性,所有元素的第一行都可以缩进一个给定长度,甚至该长度可以是负值。当然,这个属性最常见的用途是将段落的首行缩进:

<!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" />
<style type="text/css">
p{
	text-indent:2em;
}
</style>
</head>

<body>
<p>
This is paragraph element,which means that the first line will be indented a quarter-inch.The other lines in the paragraph will not be indented,no matter how long the paragraph many be.
</p>
</body>
</html>

 

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。