css 文本设置
-
color 设置文字的颜色 color:red;
-
font-size 设置文字的大小 font-size:12px;
-
font-famaily 设置文字的字体 font-family:'Microsot Yahei';
-
font-style 设置文字是否倾斜 font-style:"normal"; 不倾斜 font-style:'italic'; 倾斜
-
font-weight 设置文字是否加粗 font-weight:bold; 加粗 font-w:normal; 不加粗
-
line-height 设置文字的行高 上下同时增加高度 line-height:24px;
-
font 同时设置几个属性 顺序为 font:是否加粗 字号/行高 字体; font:normal 12px/36px '微软雅黑'
-
tex-decoration 设置文字下划线 tex-decoration:none 将文字下划线去掉
-
text-indent 设置文字首行缩进 text-indent:24px 设置文字爱首行缩进24px
div 和 em 里面的内容使用不同的格式定义
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test_style</title>
<style type="text/css">
div{
font-size:20px;
color:green;
font-family:'Microsoft Yahei';
}
em{
font-size:30px;
color:red;
font-style:normal;
font-family:'Microsoft Yahei';
}
</style>
</head>
<body>
<div>
The secret of success is constancy of purpose.
</div>
<em>
Work makes the workman.
</em>
</body>
</html>