gpt4 book ai didi

css - 什么时候不应该触发媒体查询?

转载 作者:太空宇宙 更新时间:2023-11-03 22:43:11 24 4
gpt4 key购买 nike

我有这个test page .其中有一个 .Test_container 类,除非最小宽度为 768 像素,否则它应该具有 flexbox 列布局。这是应该在 768 像素处启动的媒体查询规则。

@media (min-width: 768px) index.css:1
.u-md-flex-row {
-webkit-box-orient: horizontal!important;
-webkit-box-direction: normal!important;
-ms-flex-direction: row!important;
flex-direction: row!important;
}

如果我取消选中 `flex-direction: row 然后布局呈现在一列中。如果我在手机上查看页面或将宽度缩小到 768 像素以下,那么媒体查询仍然有效。想法?

最佳答案

你必须在你的头上添加meta标签

<meta name="viewport" content="width=device-width" />

使用您的测试页进行了尝试和测试

关于css - 什么时候不应该触发媒体查询?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43150960/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com