Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why background image is not getting responsive according to screen size?

I have used twitter bootstrap to make a webpage. I have inserted an image in background through CSS as following.

<div class="container-fluid">
    <div class="row-fluid">
        <section id="wrapper">

        </section>
    </div> 
</div>

CSS is as follows:

section#wrapper{ 
    max-width:700px; 
    background-image:url("img/crane.png");
    min-height:525px;
}

When I resize browser size the image is not getting resized according to screen size. I am not getting how to make it responsive. So please can any one help me out to resolve this issue. Thanks in advance.

like image 249
Anand Jaju Avatar asked Dec 09 '25 00:12

Anand Jaju


1 Answers

Try this

section#wrapper{ 
    background:url("img/crane.png") no-repeat center center fixed;
   -webkit-background-size: cover;
   -moz-background-size: cover;
   -o-background-size: cover;
   background-size: cover;
}
like image 98
edd Avatar answered Dec 11 '25 13:12

edd