gpt4 book ai didi

html - 为什么我的适合移动设备的媒体屏幕查询在我的手机上不起作用?

转载 作者:行者123 更新时间:2023-11-28 01:04:55 26 4
gpt4 key购买 nike

我在我的 main.css 文件中使用以下代码来执行此特定查询:

@media only screen and (max-width: 480px) {
nav ul {
margin: 0;
padding: 0;
}
nav li {
display: block;
padding: 1% 1% 1% 1%;
border-bottom: 1px solid #fff;
}
nav li:last-child{
border-bottom: none;
}
main p {
margin-bottom: 5%;
}
img {
border: 0.5px 0.5px solid #000;
}
#brands img {
width: 75%;
}
footer {
font-size: 20px;
}
}

然而,奇怪的是,当我在宽度为 360 像素的手机上查看我的网站时,查询并没有像我在笔记本电脑上调整 Chrome 窗口大小时那样显示。

Viewing via resized Chrome window on laptop. Viewing via my mobile Chrome tab on phone.我刚刚问过我的兄弟,他告诉我还有一些我应该用于移动版本的东西......那么,我在这里错过了什么?

最佳答案

您在手机上使用什么浏览器?如果它是一个过时的浏览器,它将不会应用媒体查询,因为屏幕前有单词 only

关于html - 为什么我的适合移动设备的媒体屏幕查询在我的手机上不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52433449/

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