调整背景图像不同的桌面屏幕大小

时间:2014-01-08 19:30:55

标签: css css3 media-queries

背景图片不会在具有以下样式的不同桌面屏幕上调整大小。这有什么不对?

@media
only screen and (min-resolution: 2dppx) and (min-device-width: 539px) {
    /* Large screen, retina */
    .welcome {
        background:#00ff00;
        /* link to other image */
        background-image: url('Desktop768px1024px.jpg');
        background-size: 100% 100%;
        /* hide src */
        height:0;
        width:0;

        /* just show the background */
        padding:768px 1024px;
    }
}

1 个答案:

答案 0 :(得分:0)

尝试使用此规则:

@media only screen and (min-resolution: 72dpi) and (min-device-width: 539px) {}