简体   繁体   中英

CSS background not resizing in mobile but resize works on all desktop browsers

I have a background image that will not resize in mobile. By all accounts it seems it should work as it resizes in every browser user-agent app I can find. Here is my code...

Header meta...

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

CSS

.row-feature.row-feature-primary {
background: url(../images/lonelygirl2.png) no-repeat center top fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover; 
}

I am using Joomla, and I'm linking this to a module class.

This should not be a problem, and probably not due to the CSS. I would consider reformatting the CSS like this:

.row-feature.row-feature-primary {
    background-image: url(../images/lonelygirl2.png);
    background-repeat: no-repeat;
    background-position: center top;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover; 
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM