I am facing a challenge in centering an interactive element called "container1" below the Contact and Paragraph text.
Currently, the element appears off-center to the left, and I would like it to be perfectly centered while still ensuring that the page remains responsive.
Although I can achieve centering the element, it compromises the responsiveness of the page on mobile platforms as it continues to appear offset. My priority is to maintain the responsiveness of the page.
.container1 {
width: 900px;
margin: 250px auto 0;
display: flex;
}
.container1 .box {
position: relative;
width: 300px;
height: 100px;
box-sizing: border-box;
text-align: center;
margin: 0 10px;
background: linear-gradient(to right, #4458dc 0%, #854fee 100%), radial-gradient(circle at top left, #4458dc, #854fee);
overflow: hidden;
border-radius: 4px;
box-shadow: 0 0 0 2px rgba(118, 85, 225, 1);
}
.container1 .box .icon {
width: 100%;
height: 100%;
background: linear-gradient(to right, #4458dc 0%, #854fee 100%), radial-gradient(circle at top left, #4458dc, #854fee);
transition: 0.5s;
}
.container1 .box .icon .fa {
font-size: 4em;
line-height: 100px;
color: #ffffff;
}
.container1 .box:hover .icon {
transform: scale(0);
}
.container1 .box .details {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #ffffff;
transition: 0.5s;
transform: scale(2);
opacity: 0;
}
.container1 .box:hover .details {
transform: scale(1);
opacity: 1;
}
.container1 .box .details h3 {
margin: 0;
padding: 0;
line-height: 100px;
font-size: 24px;
color: #000000;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/>
<a name="Contact"></a>
<section class="contact_area section_gap">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-8 text-center">
<div class="main_title">
<h2>Contact</h2>
<p>Please contact me with any questions, comments, or concerns</p>
</div>
</div>
</div>
</div>
<div class="container1" style="margin: auto; justify-content: center">
<div class="col-lg-8" style="display: inline-block">
<div class="box" style="">
<div class="icon"><i class="fa fa-envelope" aria-hidden="true"></i></div>
<div class='details' style="">
<h3><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="eb86928e868a8287ab8c868a8287c5888486">[email protected]</a></h3>
</div>
</div>
</div>
</div>
</section>