gpt4 book ai didi

c# - 如何通过 iPhone/iPad 检测 css 样式

转载 作者:太空宇宙 更新时间:2023-11-04 12:42:53 25 4
gpt4 key购买 nike

我想根据设备更改 css 样式。

这是我的 .css 文件。

//桌面

@media only screen and (min-width : 1224px)
{
.page
{
width: 990px;
margin-left: auto;
margin-right: auto;
}
label
{
font-family: Verdana,Arial,sans-serif;
font-size: 0.8em;
}
}

//平板电脑

@media only screen and (min-device-width : 768px) and (max-device-width : 1024px)
{
.page
{
width: 100%;
margin-left: auto;
margin-right: auto;
}
.Details
{
min-height: 125px;
min-width: 500px;
}

label
{
font-family: Verdana,Arial,sans-serif;
font-size: 0.8em !important;
}
}

//苹果手机

@media only screen and (min-device-width : 320px) and (max-device-width : 568px)
{
input[type="text"], input[type="password"]
{
width: 50px;
}

}

但它并没有改变。它只改变了桌面。我垫和 Iphone 它不工作。请告诉我我的代码有什么问题。

最佳答案

尝试

@media only screen and (min-width : 768px) and (max-width : 1024px)

而不是

@media only screen and (min-device-width : 768px) and (max-device-width : 1024px)

您还应该考虑填写您未涵盖的尺寸,以防用户使用不寻常的屏幕尺寸,例如 1024 像素和 1224 像素等。

关于c# - 如何通过 iPhone/iPad 检测 css 样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26747234/

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