常用的样式
font-family
:用于设置字体的名称或字体系列。例如,可以使用“Arial”、“Helvetica”、“sans-serif”等。font-size
:用于设置字体的大小。可以使用像素(px)、em、rem等单位来指定大小。font-weight
:用于设置字体的粗细程度。可以使用“normal”、“bold”、“bolder”、“lighter”或数字值(400为normal,700为bold)。font-style
:用于设置字体的风格。可以使用“normal”、“italic”、“oblique”或其他自定义值。text-transform
:用于设置文本的大小写形式。可以使用“uppercase”、“lowercase”、“capitalize”或“none”。text-decoration
:用于设置文本的装饰效果。可以使用“underline”、“overline”、“line-through”、“blink”或“none”。-
text-shadow
:用于设置字体阴影。可以使用像素“px”、em、rem...
font-family | 设置字体系列 | 隶书、楷书、Helvetica、Arial... |
font-size | 设置字体大小 | 10px、20px、30px... |
font-weight | 设置字体粗细 | normal、bold、bolder |
font-style | 设置字体斜体.. | italic、oblique... |
text-transform | 设置字体大小写 | uppercase、lowercase... |
text-decoration | 设置字体下滑线 | underline、overline... |
text-shadow | 设置字体阴影 | 1px 1px 2px reg,0px 0px 2px blue |
1、font-family 设置字体系如:隶书、楷书等...
<h1 style="font-family: 隶书;">隶书</h1>
<h1 style="font-family: 楷书;">楷书</h1>
2、font-size设置字体大小
<span style = "font-size:20px;">字体大小</span>
3、 font-weight设置字体粗细
<span style = "font-weight: bold;">字体粗</span>
<span style = "font-weight: normal;">字体细</span>
4、font-style设置字体的风格
<span style = "font-style: italic;">字体风格</span>
5、text-transform设置字体大小写
<h1 style="text-transform:lowercase;">HELEEE</h1>
<h1 style="text-transform:uppercase;">aaaa</h1>
6、text-decoration
设置字体下滑线
<h1 style="text-decoration: underline;">字体下划线</h1>
7、text-shadow设置字体阴影
<h1 style="text-shadow: 1px 1px 2px red,0px 0px 2px blue ;">字体阴影</h1>
总结:这7种css字体样式,就是我们比较常用的啦,当然还有很多字体样式,这里就不一一罗列出来了!