栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

在CSS网格布局中使用CSS过渡

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

在CSS网格布局中使用CSS过渡

根据规范,过渡应该在

grid-template-columns
和上进行
grid-template-rows

7.2。 明确的轨道尺寸:

grid-template-rows
grid-template-columns

属性

可动画的: 作为长度,百分比或计算的简单列表,但唯一的区别是列表中的长度,百分比或计算分量的值

因此,如果我的解释是正确的,只要对属性的值进行唯一的更改,而对规则的结构没有任何更改,则过渡应该起作用。 但是他们没有


更新

这确实有效,但到目前为止仅在Firefox中实现。


这是我创建的测试:

grid-container {  display: inline-grid;  grid-template-columns: 100px 20vw 200px;  grid-template-rows: repeat(2, 100px);  background-color: black;  height: 230px;  transition: 2s;    grid-gap: 10px;  padding: 10px;  box-sizing: border-box;}grid-container:hover {  grid-template-columns: 50px 10vw 100px;  grid-template-rows: repeat(2, 50px);  background-color: red;  height: 130px;  transition: 2s;}grid-item {  background-color: lightgreen;}<grid-container>  <grid-item></grid-item>  <grid-item></grid-item>  <grid-item></grid-item>  <grid-item></grid-item>  <grid-item></grid-item>  <grid-item></grid-item></grid-container>

在测试中,过渡效果仅适用于高度和背景色,而不适用于

grid-template-rows
grid-template-columns



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/568346.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号