1.常用的应用文本的CSS样式:

color设置文字的颜色

font-size 设置文字的大小,如font-size:12px

font-family 设置文字的字体,如font-family:‘微软雅黑’

font-style 设置文字是否倾斜,如font-style:'normal',设置不倾斜,‘italic’设置文字倾斜

font-weight 设置文字是否加粗,如font-weight:bold,设置加粗,normal,不加粗

line-height 设置文字行高,相当于在每行文字上下同时加间距,line-height:24px

font 同时设置文字的几个属性,写的顺序有兼容性问题,如下顺序:font:是否加粗 字号/行高 字体,如:font:normal 12px/36px '微软雅黑‘

text-decoration:underline 设置文字的下划线,去掉:text-decoration:none

text-indent 设置文字首行缩进,如:text-indent:24px,只针对首行

text-align 设置文字的水平对齐方式,center,left,right,

代码 <head> <meta charset="utf-8"> <title>常用文本样式</title> <style type="text/css">

div{
	font-size: 30px;
	font-family: 'Microsoft Yahei';
	font-style: italic;
	text-indent: 60px;
}

em{
	font-style: normal;
	color: gold;
}

span{
	font-weight: bold;
	line-height: 80px;
	text-decoration: underline;
	
}

a{
	text-decoration: none;  /*去掉a链接的下划线*/
	text-align: center;   /*没效果,a标签的宽带只有文字宽带*/
}

p{
    text-align: center;
}
</style>

</head>