首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

图解CSS布局(一)- Grid布局

网格内容排列方式(单个项目) justify-self属性设置单元格内容的水平位置(左中右),跟justify-items属性的用法完全一致,但只作用于单个项目。...: start; /* justify-self: center; justify-self: end;*/ } ?...分别对应justify-self三个属性值,其中stretch拉伸会占满网格整行 .item-1 { background-color: #55efc4; align-self: start...分别对应align-self三个属性值,其中stretch拉伸会占满网格整列 同样的,存在着合并简写属性place-self,可以通过这个来指定justify-self和align-self的值,前后顺序如下...: place-self: ; ---- 以上就是关于grid网格布局的全部内容了 Tips grid布局中属性有很多,一定要通过实战来记这些属性,

1.8K10

CSS Grid 那些鲜为人知的内幕

justify-items: start; } .container { justify-items: end; } .container { justify-items: center; } justify-self...我们可以使用justify-self来控制「特定网格子元素」的对齐方式 其值为以下几个: start:将网格项与其单元格的开始边缘对齐 end:将网格项与其单元格的结束边缘对齐 center:将网格项置于其单元格的中心...stretch:填充单元格的整个宽度(这是默认值) .item { justify-self: start | end | center | stretch; } .item-a { justify-self...: start; } .item-a { justify-self: end; } .item-a { justify-self: center; } .item-a { justify-self...❞ 最后,除了 justify-self,我们还有 align-self。这个属性控制单个网格项在其单元格内的垂直位置。 place-content place-content 属性是一个缩写。

11310

【图片版】CSS网格布局(Grid)完全教程

属性justify-items 和 justify-self 以行轴为参照对齐项目,属性align-items 和 align-self 以列轴为参照对齐项目。...[网格项目的对齐方式演示9] 演示程序 17 网格项目的对齐方式2 项目可以用属性align-self 和 justify-self定义自己的对齐方式,并支持如下这些属性值: auto normal start...end center stretch baseline first baseline last baseline 17.1 例48 .item1 { justify-self: start } .item2...{ justify-self: center } .item3 { justify-self: end } 属性justify-self 在行的轴线方向定义对齐方式。...[网格项目的对齐方式演示11] 演示程序 17.3 例50 .item1 { justify-self: center align-self: center } 项目1定位在行的轴线和列的轴线的中间位置

4.9K100

扫码

添加站长 进交流群

领取专属 10元无门槛券

手把手带您无忧上云

扫码加入开发者社群

相关资讯

热门标签

活动推荐

    运营活动

    活动名称
    广告关闭
    领券