常用的应用文本的css样式:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
p {
/* 设置字体颜色 */
color: red;
/* 设置字体大小 */
font-size: 30px;
/* 设置字体文体 */
font-family: "microsoft yahei";
/* 设置字体倾斜, normal设置不倾斜 */
font-style: italic;
/* 设置字体加粗, normal设置不加粗*/
font-weight: bold;
/* 设置字体行高 */
line-height: 100px;
/* 设置字体首行缩进 */
text-indent: 100px;
/* 设置文字水平剧中 */
text-align: center;
/* 设置文字间距 */
letter-spacing: 20px;
}
</style>
</head>
<body>
<p>css666</p>
</body>
</html>
设置文字的几个属性,顺序如下:
font:是否加粗 字号 /行高 字体;
p {
font: bold 20px/36px '微软雅黑';
}