How to use responsive background image in css3 in bootstrap

Faizan picture Faizan · Sep 4, 2013 · Viewed 299.8k times · Source

I dont want to use html tag. This is my css. I am using bootstrap 3.0.

background:url('images/ip-box.png')no-repeat;
background-size:100%;
height: 140px;
display:block;
padding:0 !important;
margin:0;

On 100% zoom this is OK. but when I zoom in at 180% approx, the image will be short from top and bottom, I want some css tricks.

Answer

fiskolin picture fiskolin · Sep 4, 2013

For full image background, check this:

html { 
background: url(images/bg.jpg) no-repeat center center fixed; 
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}