Currently experimenting with HTML/CSS utilizing Bootstrap v5.0 and encountering issues with the unusual interactions between floats and divs. Specifically, aiming to achieve the following: https://i.sstatic.net/4lpC2.png
Successfully achieved the desired outcome by implementing the following code:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="17757878636463657667572239263927">[email protected]</a>/dist/css/bootstrap.min.css" integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous">
<div class="container">
<div class="center-div new-page">
<div class="row g-3 d-flex d-md-block">
<div class="col-lg-6 col-md-12 float-end">
<div class="third-slogan">
<h2 class="d-none d-md-block">Perfect for Operations HR and Finance</h2>
<h2 class="d-block d-md-none">OpenType features and Variable fonts</h2>
<p class="sub-slogan">Most calendars are designed for teams. Slate is designed for freelancers who want a simple way to plan<br>their schedule.</p>
</div>
</div>
<div class="col-lg-6 col-md-12 float-start">
<div class="screen3"><img src="https://via.placeholder.com/300x100" alt="Screen 3"></div>
</div>
<div class="col-lg-6 col-md-12 center-div float-end">
<div class="buttons-page-3">
<button id="button-button" class="btn btn-rounded btn-couple-2" style="color: #FFFFFF; background-color: #03D6F3; margin-top: 0;">
Button
</button>
</div>
</div>
</div>
</div>
</div>
Applied custom CSS:
.new-page {
margin-top: 10%;
}
.center-div {
text-align: center;
}
.third-slogan {
margin-top: 18%;
padding-right: 10%;
padding-left: 10%;
}
.third-slogan h2, p {
text-align: left;
}
.sub-slogan {
font-size: 16px;
font-weight: 700;
letter-spacing: 0.2px;
color: #5C5C5C;
margin-top: 10%;
}
.screen3 img {
width: 85%;
}
.buttons-page-3 {
text-align: left;
padding-left: 10%;
}
.btn-rounded {
border-radius: 39px;
font-size: 16px;
padding-top: 18px;
padding-bottom: 18px;
padding-left: 46px;
padding-right: 46px;
}
.btn-couple-2 {
margin-top: 5%;
box-shadow: 0px 4px 31px rgba(0, 0, 0, 0.15);
margin-right: 3%
}
Encountering issues as the divs containing the floated elements (text, image, button) do not display correctly: https://i.sstatic.net/9luSV.png https://i.sstatic.net/D3no6.png https://i.sstatic.net/1bpDP.png
This poses challenges in working with the divs thereafter. Seeking insights on why this occurs and possible solutions to rectify it. Your assistance is highly appreciated.
P/s: Removing the float property on the image or button resolves the issue, but alters the desired layout where the button is positioned below the image.