I am trying to make responsive background images on a div
element but it does not work.
Here is my CSS:
.block-main{
background: url(images/ohdaihiep/bg1.png) center center/cover no-repeat;
min-height:863px;
}
You can use vh
and vw
to make it responsive:
fiddle to play around.
.block-main {
background: url(http://placekitten.com/301/301)center center/cover no-repeat;
height: 100vh;
width: 100vw;
}
<div class="block-main">
</div>