【发布时间】:2025-02-07 14:10:02
【问题描述】:
我建立了一个在我的移动设备上显示的 html 网站,而在我的 Android 设备 Galaxy S4 上显示图像背景没有问题(配置文件正在显示!),另一方面,配置文件背景不是像这样正确显示。我已经调整了 background-size 等等,但一切都是徒劳的。所以这是我的 CSS 代码如下:
@media only screen and (max-device-width: 640px) {
.hrader-part{
background: url(../images/bg_android.jpg);
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
background-size: cover;
padding-bottom: 2em;
width: 200px;
height: 300px
}
}
@media only screen and (max-device-width: 1080px) {
.hrader-part{
background: url(../images/bg_android.jpg);
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
background-size: cover;
padding-bottom: 2em;
width: 365px;
height: 100%
}
}
非常感谢朋友!
【问题讨论】: