dw中的首行缩进是哪个在css

html-css012

dw中的首行缩进是哪个在css,第1张

要实现文本首行缩进,可使用css中的text-indent实现,示例代码如下:

HTML代码:

这里是第一段文字

这里是第二段文字

CSS代码:

p{text-indent:2em}

这样就可以实现首行自动缩进两个汉字字符。

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/htmlcharset=utf-8" />

<title>缩进2字符</title>

<style type="text/css">

p{ text-indent:2em}

</style>

</head>

<body>

<p>首行缩进2字符的案例展示如下。需要多写几行看效果,需要多写几行看效果,需要多写几行看效果,需要多写几行看效果,需要多写几行看效果,需要多写几行看效果,需要多写几行看效果。</p>

</body>

</html>