CSS技術總結

來源:互聯網
上載者:User

一、css選取器:1、標記選取器:h1{color:red;}

                               2、類別選取器:.class{}  如:.one{color:red;}

                               3、ID選取器:#ID{}  如:#two{color:red;}

二、選取器的聲明:h1,h2,p{color:red;} 或h1,.special,#one{color:red;}

三、選取器的嵌套:p b{color:red;} (注釋:b標記包含在p標記中)              註:嵌套會有父子關係,所以得注意父子關係(即繼承關係)影響樣式。

--------------------------------------

四、div與span標記:div不同行,span同行

五、盒子模型:border(邊框),padding(內邊距:即內容與邊框之間的間隙),margin(邊緣:即一個div與另一個div的間距)


六、元素的定位:1、float定位:如:left

                                2、position定位:如:absolute

                                3、z-index定位:即Z座標定位

七、背景圖片屬性設定:

repeat 預設。背景映像將在垂直方向和水平方向重複。
repeat-x 背景映像將在水平方向重複。
repeat-y 背景映像將在垂直方向重複。
no-repeat 背景映像將僅顯示一次。
inherit 規定應該從父元素繼承 background-repeat 屬性的設定。

 

http://www.w3school.com.cn/css/


相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.