好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

css中设置段落缩进的属性是什么

css中设置 段落缩进 的属性是“text -i ndent”,语法格式“text-indent:length|%;”;当值为“length”时可定义固定的缩进,当值为“%”类型时可定义基于父元素 宽 度的百分比的缩进。

本教程操作环境:windows7系统、CSS3 && HT ML 5版、Dell G3 电 脑。

css中设置段落缩进的属性是“text-indent”。

示例:

<!DOCTY PE  html>
<html>
	<head>
		< ;m eta charset="UTF-8">
		<t IT le>首行缩进</title>
		<style>
			.demo{
				width: 500px;
				h ei ght: 200px;
				m arg in: 50px auto;
			}
			.p1{
				text-indent:36px;
			}
			.p2{
				text-indent:1em;
			}
			. P3 {
				text-indent:10%;
			}
		</style>
	</head>
	<body>
		<div class="demo">
			<p class="p1">这是一段测试代码,是关于css文本缩进的一段文字。这是一段测试代码,是关于css文本缩进的一段文字。这是一段测试代码,是关于css文本缩进的一段文字。这是一段测试代码,是关于css文本缩进的一段文字。这是一段测试代码,是关于css文本缩进的一段文字。这是一段测试代码,是关于css文本缩进的一段文字。<b>text-indent:36px;</b></p>
		    <p class="p2">这是一段测试代码,是关于css文本缩进的一段文字。这是一段测试代码,是关于css文本缩进的一段文字。这是一段测试代码,是关于css文本缩进的一段文字。这是一段测试代码,是关于css文本缩进的一段文字。这是一段测试代码,是关于css文本缩进的一段文字。这是一段测试代码,是关于css文本缩进的一段文字。<b>text-indent:1em;</b></p>
		    <p class="p3">这是一段测试代码,是关于css文本缩进的一段文字。这是一段测试代码,是关于css文本缩进的一段文字。这是一段测试代码,是关于css文本缩进的一段文字。这是一段测试代码,是关于css文本缩进的一段文字。这是一段测试代码,是关于css文本缩进的一段文字。这是一段测试代码,是关于css文本缩进的一段文字。<b>text-indent:10%;</b></p>
		</div>
	</body>
</html>

效果图:

【推荐教程:CSS视频教程】

说明:

text-indent 属性规定文本块中首行文本的缩进。

注意: 负值是允许的。如果值是负数,将第一行左缩进。

属性值:

值 描述
length 定义固定的缩进。默认值:0。
% 定义基于父元素宽度的百分比的缩进。

更多编程相关知识,请访问:编程视频!!

以上就是css中设置段落缩进的属性 是什么 的详细内容,更多请关注其它相关 文章 !

总结

以上是 为你收集整理的 css中设置段落缩进的属性是什么 全部内容,希望文章能够帮你解决 css中设置段落缩进的属性是什么 所遇到的问题。

如果觉得 网站内容还不错, 推荐好友。

查看更多关于css中设置段落缩进的属性是什么的详细内容...

  阅读:22次