常用文本样式:
- color:设置文字颜色:red
color: red;
- font-size:设置文字大小
font-size:12px;
- font-family:设置文字字体
- font-family:'微软雅黑';
- font-style:设置文字是否倾斜
font-style: normal; 不倾斜
font-style: italic; 倾斜
- font-weight:设置文字是否加粗
font-weight: bold; 加粗
font-weight: normal; 不加粗
- line-height:设置文字行高(行高相当于每行文字的上下同时加间距)
line-height: 36px;
- font:设置文字的几个属性,是否加粗,字号/行高,字体
font: bold 12px/36px '微软雅黑';
- text-indent:设置文字首行缩进
text-indent: 60px;
- text-align:设置文字首行对其方式;
text-align: center;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
.box1{
color: red;
font-size:12px;
font-family: 'Microsoft YaHei UI';
font-style: italic;
font-weight: bold;
font: bold 12px/36px 'Microsoft YaHei UI';
line-height: 36px;
text-align: center;
text-indent: 60px;
}
</style>
</head>
<body>
<div class="box1">文本样式1111111111111111111111<br>哈哈哈2222222222222222222222</div>
</body>
</html>