vertical-algin: 段落垂直对齐设置值:sub(垂直对齐文本的下标。) super(垂直对齐文本的上标) top(上) middle(中) bottom(下) 10px -10px 相对于元素行高属性的百分比
letter-spacing: 字母的间距
word_spacing: 单词的间距
line-height: 文本行高
text-indent: 缩进方式
white-space: 排版方式设置值:normal (默认,空白会被忽略) pre(原样显示) nowrap(文本不会换行)
解决:这样就好了。
Css
<style type="text/css">
.one{
font-size:10px
color:#FF0000
font-weight:bold
}
.two{
font-size:18px
color:#00FF00
text-decoration:underline
}
.three{
font-size:18px
color:#0000FF
text-decoration:overline
}
</style>
Html
<p class="one">加油、努力</p>
<p class="two">加油、努力</p>
<p class="three">加油、努力</p>
呵呵。
<!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=gb2312" />
<title>无标题文档</title>
<style type="text/css">
*{ margin:0padding:0}
p{ width:600pxheight:32pxborder:1px solid greenmargin:20px auto 0 autoline-height:32px/*使段落中文字垂直居中*/}
.one{ text-indent:24px/*文本缩进*/ margin-top:100px}
</style>
</head>
<body>
<p>段落中的文字垂直居中,离上面20个像素的距离</p>
<p class="one">段落中年文字开头空2个字,离上面一个p100像素</p>
</body>
</html>