css常用属性

  1. 布局与定位(核心中的核心)

display: flex; / inline-flex;:开启弹性布局。
justify-content:主轴对齐方式(如 center, space-between)。
align-items:交叉轴对齐方式(如 center, flex-start)。
flex-direction:主轴方向(row, column)。
flex-wrap:是否换行。
Grid:
display: grid;:开启网格布局。
grid-template-columns / grid-template-rows:定义列和行的大小。
gap:设置网格之间的间距。
传统定位与显示:
position:定位模式(relative, absolute, fixed, sticky)。
top, right, bottom, left:配合定位使用的偏移量。
z-index:控制元素的堆叠顺序。
display:元素的显示类型(block, inline, none, inline-block)。

posted @ 2026-07-09 17:38  张家滕111  阅读(3)  评论(0)    收藏  举报