圖解css選擇器-grid-flex

css 選擇器

預覽 選擇器 描述
img a > b 子組合器 選擇直接位於 a 元素內部的所有 b 元素。
img a b 後代組合子 選擇 a 元素內任意位置的所有 b 元素。
img a + b 相鄰兄弟組合子 選擇緊鄰 a 元素的所有 b 元素。
img a ~ b 通用兄弟組合子 選擇 a 元素之後任意位置的所有 b 元素。
img .cl 類選擇器 選擇具有 cl 類名稱的所有元素。
img a.cl 標籤 + 類選擇器 選擇所有具有 cl 類名稱的 a 元素。
img .cl1.cl2多類 選擇器 選擇同時具有 cl1 和 cl2 類名的所有元素。
img a[x=y] 屬性選擇器 選擇所有 x 屬性設置爲 y 的元素。
img #id1 ID 選擇器 選擇 ID 名稱爲 id1 的元素。
img ***** 通用選擇器 選擇所有元素。

css 盒子模型

預覽 財產 描述
img box-sizing: border-box width和的height大小爲content+ padding+border
img box-sizing: content-box widthheight的大小正好content

flex

img

grid

align-content沿水平軸分佈內容。

img align-content: start img align-content: space-around
img align-content: center img align-content: space-between
img align-content: end img align-content: stretch

justify-content垂直軸

img justify-content: start img justify-content: space-around
img justify-content: center img justify-content: space-between
img justify-content: end img justify-content: stretch

align-items網格區域內沿水平軸分佈內容

img align-items: start img align-items: center
img align-items: end img align-items: stretch

justify-items在其網格區域內沿垂直軸分佈內容。

img justify-items: start img justify-items: center
img justify-items: end img justify-items: stretch

img

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章