Renegade Rob Renegade Rob - 1 year ago 82
CSS Question

CSS Body Image stretches when on a mobile device

I have the following CSS script that I would like help with. When its on a PC it looks fine, but when its on a mobile device its stretched. Is there anything I can add to it to keep the aspect ratio please?

body {
font-family: 'Open Sans', sans-serif;
background:url(../images/bg.jpg) no-repeat center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-size: 100% 100%;

Thanks all


Answer Source

If you remove background-size: 100% 100% it should work for you.


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download