【CSS3】CSS——字體

CSS字體屬性
屬性 描述
font 簡寫屬性
font-family 設置字體系列
font-size 設置字體尺寸
font-style 設置字體風格
font-variant 以小型大寫字體或者正常字體顯示文本。
font-weight 設置字體粗細

1.font:在一個聲明中設置全部字體屬性css

能夠按照如下順序顯示:html

  • font-style
  • font-variant
  • font-weight
  • font-size/line-height
  • font-family

例如:font:italic bold 12px/20px arial,sans-serif;wordpress

2.font-family:設置字體系列學習

大神就是大神,每一個知識點都辣麼認真  http://www.zhangxinxu.com/wordpress/?p=5474字體

參考這篇文章http://www.cnblogs.com/fsjohnhuang/p/4310533.htmlui

3.font-size:設置字體尺寸(默認值:medium)spa

<html> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <style type="text/css"> 
        body{ font-size:12px; line-height:24px;} 
        .exp1{font-size:12px;} 
        .exp2{font-size:xx-small;} 
        .exp3{font-size:small;} 
        .exp4{font-size:x-large;} 
        .exp5{font-size:larger;} 
        .exp6{font-size:smaller;} 
        .exp7{font-size:50%;} 
        .exp8{font-size:150%;} 
    </style> 
    </head> 
    <body> 
        <div class="exp1">我被font-size值爲12px大小</div> 
        <div class="exp2">我被font-size值爲xx-small大小</div> 
        <div class="exp3">我被font-size值爲small大小</div> 
        <div class="exp4">我被font-size值爲x-large大小</div> 
        <div class="exp5">我被font-size值爲larger大小</div> 
        <div class="exp6">我被font-size值爲smaller大小</div> 
        <div class="exp7">我被font-size值爲50%大小</div> 
        <div class="exp8">我被font-size值爲150%大小</div> 
    </body> 
</html>

原文地址:http://www.divcss5.com/rumen/r322.shtmlcode

4.font-weight:設置字體粗細orm

.font1{
    font-weight:normal;
    font-weight:bold;
    font-weight:border;
    font-weight:lighter;
    font-weight:800;
}

顯示效果:htm

注意:400 等同於 normal,而 700 等同於 bold。

5.font-variant:以小型大寫字體或者正常字體顯示文本

對中文沒有影響,對英文有影響

.font1{
    font-variant:normal;
    font-variant:small-caps;
}

6.font-style:設置字體樣式

.font1{
    font-style:normal;
    font-style:italic;
    font-style:oblique;
}

 

 

最後,給本身一段激勵的話,但願本身堅持寫博客的習慣,相信堅持後必定會出現奇蹟,由於我想站在奇蹟的那一堆人當中。

後面有須要補充的,會在工做中繼續學習,總結更多的經驗

相關文章
相關標籤/搜索