I'm trying to make the img in my bootstrap carousel responsive. I tried changing the height and width in the css but it doesnt seems to work.
I want the height to be 100vh and the width to whatever the img's width is. The overflow part can be hidden but the img has to be to scale. Right now it looks like this when the screen is smaller.
Here's the code.
@media only screen and (max-width : 768px) {
.carousel-inner > .item > img {
height: 100vh;
width: auto;
overflow: hidden;
}
}
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="photos/JO2_2978.JPG" alt="xmas_orchestra">
</div>
</div>