gpt4 book ai didi

html - 手机横屏时出现黑 block

转载 作者:太空宇宙 更新时间:2023-11-03 18:55:32 25 4
gpt4 key购买 nike

在我的 iPhone 4 上查看此网站时,一切看起来都是纵向布局。当旋转以在横向布局中查看时,有一个 div 负责在屏幕中间创建一个黑色 block (下图)。

CSS 非常基础

width: 100%;
img {
margin-top: 50px;
max-width: 100%;
}

有什么建议吗?

提前致谢

最佳答案

现在用于媒体查询标准设备

/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}

/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
/* Styles */
}

/* Smartphones (portrait) ----------- */
@media only screen
and (max-width : 320px) {
/* Styles */
}

/* iPads (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px) {
/* Styles */
}

/* iPads (landscape) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : landscape) {
/* Styles */
}

/* iPads (portrait) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : portrait) {
/* Styles */
}

/* Desktops and laptops ----------- */
@media only screen
and (min-width : 1224px) {
/* Styles */
}

/* Large screens ----------- */
@media only screen
and (min-width : 1824px) {
/* Styles */
}

/* iPhone 4 ----------- */
@media
only screen and (-webkit-min-device-pixel-ratio : 1.5),
only screen and (min-device-pixel-ratio : 1.5) {
/* Styles */
}

more information

关于html - 手机横屏时出现黑 block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13577039/

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