I am using bootstrap carousal and having some problem with image height and width. Even though I define it in the img attribute it still displays a
bootstrap
img
You can place height in css and add !important because bootstrap is overriding your height with auto , and object-fit:cover; will work like background size cover a fiddle
.carousel{ width:300px; } .item img{ object-fit:cover; height:300px !important; width:350px; }