CSS基本屬性

2021-10-04 06:15:00 字數 1218 閱讀 4769

background(背景)

background- color           /*背景色*/

background- image /*背景*/

background- repeat /*背景圖平鋪方式*/

簡寫:

background: gray url(***/xx. png)  no-repeat; 

/*背景色,背景,平鋪方式*/

font(字型)

font-style: italic;      /*斜體*/

font-weight:bold; /*加粗*/

font-family: arial, sans-serit; /*字型種類*/

font-size:20px; /*字型大小大小*/

line-height:35px; /*行高*/

簡寫:

font: italic bold  20px/35px aria,sans-serf,"微軟雅黑";

/*斜體字,加粗,字型大小大小,預設字型,備用字型,備用字型*/

marain(邊距)

margin-top

margin-right

margin-bottom

margin-left

簡寫:

margin : 10px 15px 10px 15px ;

/*邊距上,右,下,左(按照順時針方向)*/

注意,如果寫成3個或2個則含義不同

margin : 10px 15px 15px ;

/*邊距上,左右,下*/

margin : 10px 15px ;

/*邊距上下,左右*/

margin : 10px ;

/*邊距上下左右*/

padding(填充)

padding-top

padding-right

padding-bottom

padding-left

簡寫寫法與margin一樣

CSS基本屬性

一 visibility屬性 display none 隱藏元素 visibility 顯示 隱藏的 取值 1 visible 預設的可見的 2 hidden 隱藏 依然佔據頁面空間 3 collapse 使用在 元素上 刪除一行和一列的時候不影響 的整體布局 diplay 和 visibility...

搞定css基本屬性

css層疊樣式表,級聯樣式,簡稱才是樣式表 實現了內容和表示的分離 css和html之間的關係 html是負責網頁的結構 css 是負責構建html元素的樣式 css作用 1.以統一的方式實現樣式的定義 2.提高頁面樣式的可重用性和可維護性 內聯樣式 行內樣式 內部樣式 在head標籤中 外部樣式表...

CSS基本屬性(三)

css基本屬性3 transition 復合屬性 檢索或設定物件變換時的過渡。檢索或設定物件中的參與過渡的屬性 none 不指定過渡的css屬性 all 所有可以進行過渡的css屬性 自定義屬性 指定要進行過渡的css屬性 檢索或設定物件過渡的持續時間 時長 指定物件過渡的持續時間 單位s秒 檢索或...