设为首页 - 加入收藏 ASP站长网(Aspzz.Cn)- 科技、建站、经验、云计算、5G、大数据,站长网!
热搜: 创业者 手机 数据
当前位置: 首页 > 服务器 > 系统 > 正文

详解css3中dispaly的Grid布局与Flex布局(7)

发布时间:2020-09-24 21:35 所属栏目:52 来源:网络整理
导读:.content-box { justify-content: start | end | center | stretch | space-around | space-between | space-evenly; align-content: start | end | center | stretch | space-around | space-between | space-even

.content-box { justify-content: start | end | center | stretch | space-around | space-between | space-evenly; align-content: start | end | center | stretch | space-around | space-between | space-evenly; }

下面的图都以justify-items属性为例,align-items属性的图完全一样,只是将水平方向改成垂直方向。

start: 对齐容器的起始边框。

end: 对齐容器的结束边框。

center: 容器内部居中。

stretch: 项目大小没有指定时,拉伸占据整个网格容器。

space-around: 每个项目两侧的间隔相等。所以,项目之间的间隔比项目与容器边框的间隔大一倍。

space-between: 项目与项目的间隔相等,项目与容器边框之间没有间隔。

space-evenly: 项目与项目的间隔相等,项目与容器边框之间也是同样长度的间隔。

place-content属性

place-content属性是align-content属性和justify-content属性的合并简写形式。

place-content: <align-content> <justify-content>;

place-content: space-around space-evenly;

如果省略第二个值,浏览器就会假定第二个值等于第一个值。

grid-auto-columns 属性, grid-auto-rows 属性

一、有时候,一些项目的指定位置,在现有网格的外部。比如网格只有3列,但是某一个项目指定在第5行。这时,浏览器会自动生成多余的网格,以便放置项目。

(编辑:ASP站长网)

网友评论
推荐文章
    热点阅读