天天看點

第17天:CSS引入、選擇器優先級(中級)

一、CSS 位置

  1、行内式  css  

   <div class="fr" style="color:red;">aa</div>

  2、 内嵌式樣式

  <style>

    .one {

        width: 200px;

    }

</style>

  3、外鍊式

 <link rel=”stylesheet” href =”css/base.css” />

二、Font 字型綜合寫

Font: 字型加粗  字号/行高 字型;

  必須有字号和字型。

Font-weight:bold;   700    

  S  del    删除線

  I   em   傾斜

  U   ins   下劃線

      字型加粗  font-weight: 700;  

      讓字型不加粗:  font-weight:normal;

      字型傾斜:  font-style:italic;  不用

      字型不傾斜: font-style:normal;

      不下劃線 不删除線:  text-decoration: none;

      定位:  position:static;  靜态定位   約等于标準流

      浮動的不浮動: float:none;      none  left  right

      定位的不定位:  position: static;    absolute  relative  fixed

三、選擇器的優先級

      标簽  (1) < 類(10 ) < id(100 ) < 行内(1000)     

      網頁穩定:

        Width 和height  最穩定

        其次 padding     

        最後才考慮margin