gpt4 book ai didi

html - IPAD 的 CSS 样式不起作用

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

问题:我有以下针对页脚手机的样式:

@media (max-width: 800px){
#footer-affiliation {
background-color: #0077C0;
color: rgb(255, 255, 255);
padding: 5px;
height:110px;


width:109.01% !important;
margin-left:-15px;
}
}

但是,它会影响 IPAD 上的页脚。我执行了以下操作以仅针对 IPAD 和 iPhone。对于 iphone css 样式工作正常,但是对于 IPAD 样式不起作用:

    @media only screen 
and (min-device-width : 480px)
and (max-device-width : 800px)
and (orientation : portrait) {
#footer-affiliation {
background-color: #0077C0;
color: rgb(255, 255, 255);
padding: 5px;
height:110px;


width:104% !important;
margin-left:-15px;
}
}

我想知道我可以采取哪些其他方法来仅针对 IPAD。

谢谢

最佳答案

针对 iPad 使用以下媒体查询

@media only screen and (device-width: 768px) {
/* For general iPad layouts */
}

@media only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:portrait) {
/* For portrait layouts only */
}

@media only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape) {
/* For landscape layouts only */
}

本网站提供了 iPad 中各种设备的详细信息

CSS media Queries for iPad

关于html - IPAD 的 CSS 样式不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40289256/

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