I am using bootstrap 5 to create a design where the Navbar is set to container and the hero header piece right below exceeds the space of the container on the right side only.
Here is an image of the design I am trying to achieve:
So far, I am using "container" for the navbar and "container-fluid" for the header piece right below, but I am unsure how to align the text on the left with the logo/container size.
Here is what I have so far:
<div class="container-fluid-md m-0 p-0">
<div class="row mt-5 m-0 p-0">
<div class="col-lg-6 m-0">
<h1>Lorem Ipsum</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p>
<div class="row">
<div class="col-sm-12">
<button class="btn blue-solid-button btn-sm">Learn more</button>
<button class="btn white-solid-button btn-sm">Contact us</button>
</div>
</div>
</div>
<div class="col-lg-6 m-0 p-0">
<img class="img-fluid curve-home" src="https://images.unsplash.com/photo-1429041966141-44d228a42775?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80">
</div>
</div>
</div>
My other approach is to set both containers to "container" and use a type of overflow option for the bottom container.
Here is my code for that option:
body {overflow-x:hidden}
.mt-n1 {
z-index: 3;
background-image: url(https://images.unsplash.com/photo-1429041966141-44d228a42775?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80);
position: relative;
}
.mt-n1:after {
content: '';
position: absolute;
top: 0;
bottom: 0;
left:80%;
right:-3000px;
background-image: url(https://images.unsplash.com/photo-1429041966141-44d228a42775?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80);
z-index: -1;
}
<div class="container-lg">
<div class="row mt-5 m-0 p-0">
<div class="col-lg-6">
<h1>Lorem Ipsum</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<div class="row">
<div class="col-sm-12">
<button class="btn blue-solid-button btn-sm">Learn more</button>
<button class="btn white-solid-button btn-sm">Contact us</button>
</div>
</div>
</div>
<div class="col-lg-6 m-0 p-0">
<div class="mt-n1">
<img class="img-fluid curve-home" src="https://images.unsplash.com/photo-1429041966141-44d228a42775?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80" alt="pipelines">
</div>
</div>
</div>
</div>