When it comes to tackling this task, there are numerous approaches you could take. I'm going to showcase one method that aligns perfectly with your current webpage and requirements.
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 d-flex align-items-end overflow-hidden banner-image-container">
<img class="img-responsive" src="img/top-banner.jpg" width="100%">
</div>
(Placed within your <style
tag:)
.overflow-hidden {
overflow: hidden;
}
.banner-image-container {
max-height: 400px;
}
Essentially, what I've done here is constrained the image container's height to a maximum of 400 pixels. As the image exceeds this size, I've utilized overflow: hidden;
so only the necessary portion of the image is displayed. This ensures the main focus remains on the building in the image by positioning it at the top using d-flex align-items-end
.