图解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

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