设置字体
body{font-family:"Microsoft Yahei";}
设置字号、颜色
body{font-size:12px;color:#666}
设置粗体
p span{font-weight:bold;}
设置斜体
p a{font-style:italic;}
设置下划线
p a{text-decoration:underline;}
设置删除线
.oldPrice{text-decoration:line-through;}
设置段落首字母缩进
p{text-indent:2em;}
设置段落行高(行间距)
p{line-height:2em;}
设置中文字间距、字母间距、英文单词间距
<!--中文字间距、字母间距-->
h1{
letter-spacing:50px;
}
<!--英文单词间距-->
h1{
word-spacing:50px;
}
段落排版对齐
- 为块状元素中的文本、图片设置居中样式,可以使用text-align样式代码。
h1{
text-align:center;
<!--center居中 left居左 right居右-->
}