有很多,这里介绍几种常用的方法。
1.font-weight属性
font-weight属性是CSS中用来控制文字粗细的属性,它的值可以是normal、bold、bolder、lighter、100~900之间的数字,其中normal表示普通粗细,bold表示加粗,bolder表示更加粗,lighter表示更加细,100~900表示100粗到900粗的变化。
p { font-weight: bold; }
2.text-decoration属性
text-decoration属性是CSS中用来控制文字装饰的属性,它的值可以是none、underline、overline、line-through,其中none表示无装饰,underline表示加下划线,overline表示加上划线,line-through表示加删除线。
p { text-decoration: underline; }
3.text-shadow属性
text-shadow属性是CSS中用来控制文字外观的属性,它的值可以是none、[x-offset] [y-offset] [blur-radius] color,其中none表示无阴影,x-offset表示阴影在水平方向的偏移量,y-offset表示阴影在垂直方向的偏移量,blur-radius表示阴影的模糊半径,color表示阴影的颜色。
p { text-shadow: 0px 0px 5px #000; }
4.letter-spacing属性
letter-spacing属性是CSS中用来控制文字间距的属性,它的值可以是normal、length,其中normal表示正常间距,length表示字符间距,单位可以是px、em、rem等。
p { letter-spacing: 2px; }
5.word-spacing属性
word-spacing属性是CSS中用来控制文字间距的属性,它的值可以是normal、length,其中normal表示正常间距,length表示词间距,单位可以是px、em、rem等。
p { word-spacing: 2px; }
6.line-height属性
line-height属性是CSS中用来控制文字行高的属性,它的值可以是normal、number、length、percentage,其中normal表示正常行高,number表示行高与字号的比值,length表示行高的固定值,percentage表示行高与字号的百分比值。
p { line-height: 1.5; }
以上就是,在实际应用中,可以根据需要灵活组合使用这些属性,以达到自己想要的效果。