In creating a simple address panel, I have divided it into three sections: address, phone number, and email. Each section includes an icon and a paragraph next to it. To align these sections side by side, I used the vertical-align: top and display: table properties. Additionally, I added a border-left property to the main div containing all the sections. My goal is to design the layout in such a way that the line passes through the icons without extending beyond the top and bottom of each icon.
Here is the HTML part:
<div class="row">
<div class="col-md-6 col-sm-12">
<h2 class="heading-title">Drop in our office</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<div class="address-top">
<div class="address-repeat">
<div class="address-left">
<div class="body-widget">
<i class="fa fa-map-marker" aria-hidden="true"></i>
</div>
</div>
<div class="address-right">
<div class="body-widget">
<label>ADDRESS</label>
<p>Huatai Securities (USA)10 Hudson Yards 41FlNY, NY 10001</p>
</div>
</div>
</div>
<div class="address-repeat">
<div class="address-left">
<div class="body-widget">
<i class="fa fa-phone" aria-hidden="true"></i>
</div>
</div>
<div class="address-right">
<div class="body-widget">
<label>LETS TALK</label>
<p>212-763-8166</p>
</div>
</div>
</div>
<div class="address-repeat">
<div class="address-left">
<div class="body-widget">
<i class="fa fa-envelope" aria-hidden="true"></i>
</div>
</div>
<div class="address-right">
<div class="body-widget">
<label>GENERAL SUPPORT</label>
<p><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c6a4a9a7b4a2a9a0a0afa5a386aeb2b5a5e8a5a9ab">[email protected]</a></p>
</div>
</div>
</div>
</div>
</div>
Here is the CSS part:
.address-left, .address-right{
vertical-align: top;
height: 100%;
display: table-cell;
}
.address-left{
width:50px;
box-sizing: border-box;
padding: 20px 0 0 0;
}
.address-right{
width: 200px;
max-width: 100%;
box-sizing: border-box;
padding: 25px 0 0 0;
}
.address-repeat{
width: 100%;
margin: 20px 0 0 -12px;
}
.address-top{
width: 100%;
border-left:2px solid #d5d5d5;
margin: 20px 0 0 10px;
}
#contact-us .address-right p{
color:#5e5e5e;
font-family: 'Montserrat-Regular';
padding: 0;
margin: 0;
letter-spacing: 0.5px;
font-size:14px;
width:200px;
font-weight: lighter;
}
#contact-us label{
font-family: 'HelveticaNeueLTStd-HvCn';
font-size:17px;
color:#343434;
}
#contact-us i{
color:#ffffff;
font-size: 15px;
border-radius:50%;
width:25px;
height:25px;
line-height:23px;
padding:1px 0 0 6px;
background-color:#e70020;
}