Chapter 8 字体和颜色样式

2019-03-13  本文已影响0人  Smnag
字体 font-family
@font-face {  
        font-family: "fontname" 
        src: url("http://.......woff")
        src: url("http://.......ttf")
}

web字体托管网站:www.fontsquirrel.comwww.google.com/webfonts

大小 font-size

1、选择一个关键字(推荐small或medium),指定作为body规则中的字体大小,这相当于页面的默认字体大小。
2、使用em或百分数,指定其它元素字体相对于body字体的大小。1.2em=120%
xx-small x-small small(12px) medium large x-large xx-large 依次递增20%

行间距 line-height

line-height:1.6em 即行间距为字体大小的1.6em

颜色 color

表示颜色的四种方法
1、指定名称,只支持150种,如blue、red
2、rgb(80%, 40%, 0%),指红绿蓝分别占80%、40%、0%
3、rgb(204, 102, 0)含义同上,25580%=204
4、rgb(#cc6600)是16进制表示法,cc=12
16+12=204、66=6*16+6=102

粗细 font-weight

值可以为:lighter、normal、bold、bolder或者100-900的整数

风格 font-style

斜体 font-style: italic几乎等于font-style: oblique

划线 text-decoration

underline、overline、line-through(也可在html中使用<del>和<ins>)

上一篇 下一篇

猜你喜欢

热点阅读