`
七里枫香
  • 浏览: 14066 次
  • 性别: Icon_minigender_1
  • 来自: 天津
社区版块
存档分类
最新评论

HTML文本首行文本缩进

    博客分类:
  • HTML
阅读更多
  HTML文本首行文本缩进,可以用<p style="text-indent:2em">,这里的2em代表的是4个字节,相当于2个汉字,4个英文字母.
源码如下:
<!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></title>
<style>
#main{width:960px;margin:0 auto 0 auto;text-align:center;}
#head{ height:50px;margin:30px auto 20px auto;}
#body{ font-size:16px; text-align:left; text-indent:2EM;}
</style>
</head>

<body><div id="main">
<div id="head">V网</div>
<div id="body">
  <p>关于V网11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111<br/>七里枫香</p>
</div>
</div>
</body>
</html>
1
1
分享到:
评论
1 楼 cloverprince 2011-04-05  
一个em是一个大写M的宽度(对于汉字,反正不分大小写,就是一个字啦)。

相关推荐

Global site tag (gtag.js) - Google Analytics