**已关闭。**此问题需要debugging details。目前不接受回答。
编辑问题以包括desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem。这将帮助其他人回答问题。
昨天就关门了。
这篇文章是在3小时前编辑并提交审查的。
Improve this question的
的数据
我尝试使用CSS网格与2列,但框C将结束在下面的B像这样
的
有什么建议吗?
编辑(已解决)
其解决方法是:
min-content
网格的第一行高度- 使用
order
属性重新排序子项目 - 框B具有2行跨距
- 在框C上设置色谱柱起点
盒子A、B、C可以是任意高度
.container {
display: grid;
}
.box-a {
height: 500px
}
.box-b {
height: 600px;
}
.box-c {
height: 200px;
}
@media(min-width: 1024px) {
.container {
grid-template-columns: repeat(2, minmax(0, 1fr));
grid-template-rows: min-content 1fr;
}
.box-a {
order: 2;
}
.box-b {
order: 1;
grid-row: span 2 / span 2;
}
.box-c {
order: 3;
grid-column-start: 2;
}
}
1条答案
按热度按时间u0njafvf1#
您可以使用媒体查询来实现这一点:在这个例子中,如果设备的宽度超过768像素,它将显示移动的视图,否则桌面一个。
个字符