我想让 css 网格出现在手机版本上,但我只希望带有 flexbox 的基本 css 出现在桌面版本上。我的网站将首先是移动设备,因为它将是图片库。
最佳答案
您可以使用 media query ,例如:
// will be applied by default
.element {
display: grid;
}
// will overwrite the display when the screen has a larger width than 768px
@media (min-width: 768px) {
.element{
display: flex;
}
}
关于html - 如何使CSS网格只出现在手机上而不出现在桌面上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54478416/