响应式设计似乎并不完美

时间:2016-09-09 11:44:35

标签: android html5 css3 responsive

我遇到了网页的响应问题。我使用了几个网站和Chrome的开发工具来确定问题,但他们都正确地展示了它。一旦我打开手机上的页面(三星Galxy S5),背景就会变白,只能看到文字。这是我的媒体查询:

@media (max-width: 768px) {
    body {
        background-image: url(images/bg-img.jpg);
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-size: cover;
        -webkit-background-size: cover;
        -moz-background-size: cover;
        margin: 0;
    }
}

以下是整个代码:https://jsfiddle.net/Manny5980/uwa4np7v/

2 个答案:

答案 0 :(得分:0)

警报在webview中不起作用,您应该使用document.write

答案 1 :(得分:0)

请访问

https://responsivedesign.is/develop/browser-feature-support/media-queries-for-common-device-breakpoints

/ *三星Galaxy S5 ----------- * /

@media only screen and(min-device-width:360px)and (max-device-height:640px)和 (方向:横向)和(-webkit-device-pixel-ratio:3){

/ *样式* /

}

仅@media屏幕和(min-device-width:360px)和(max-device-height:640px)和(orientation:portrait)和(-webkit-device-pixel-ratio:3){

/ *样式* /

}