-1

I tried with

.slider {
    background: url(../images/slid1.jpg) no-repeat 0px 0px;
    background-size: cover;
max-width: 100%;
    min-height:800px;
 
}
.slider1 {
    background: url(../images/slid2.jpg) no-repeat 0px 0px;
    background-size: cover;
}
.slider2 {
    background: url(../images/slid3.jpg) no-repeat 0px 0px;
    background-size: cover;
}
i want to know how to make this div image responsive?
jeroen
  • 91,079
  • 21
  • 114
  • 132

1 Answers1

-1

In your example css you are using background-size:cover. This property causes the image to scale to the smallest size in where both the width and height of the image are at least the size of the container. background-size:contain might be give the behaviour you want. It is the opposite of cover, in that it tries to scale the image to be as big as possible in the allocated space without clipping.

.img
{
  background-image:url(https://cdn.sstatic.net/Sites/stackoverflow/img/favicon.ico?v=4f32ecc8f43d);
  background-repeat:no-repeat;
  background-size:contain;
  min-height:400px;
  max-width:50%;
}
<div class="img">
</div>
Yemachu
  • 144
  • 5