Centre an Icon within a div - Bootstrap 3 & Font Awesome - html

I have a simple bootstrap grid with a row displaying some text in one column and a stacked font-awesome icon set in another column. The issue I'm having is the icon-set is not vertically aligned in the middle of the div, as the text is. As you can see the icon is more aligned to the top of the div. Is there a way to center align this?
I've created a fiddle here and re-posted the code below:
html:
<div class="container-fluid">
<div class="row posted-content">
<div class="col-md-10">
<h4 class="text-primary pull-left">Hey, this is some text</h4>
</div>
<div class="col-md-2 comment-count pull-right">
<a class="fa-stack comment-action">
<i class="fa fa-comment-o fa-fw fa-stack-2x"></i>
<i class="fa fa-stack-1x">5</i>
</a>
</div>
</div>
</div>
css:
.posted-content {
border-radius: 4px;
border-color: #e7e7e7;
border: 1px solid rgba(0, 0, 0, 0.1);
max-width: 1140px;
background-color: #f8f8f8;
margin-bottom: 0px;
vertical-align: middle;
}
I've tried playing with vertical-align but to no avail. Any ideas appreciated.

Try this
<div class="container-fluid">
<div class="row posted-content centered-vertically">
<div class="col-md-10">
<h4 class="text-primary pull-left">Hey, this is some text ghssd fjkflsdj sdfkkl;asdk</h4>
</div>
<div class="col-md-2 comment-count pull-right">
<a class="fa-stack comment-action">
<i class="fa fa-comment-o fa-fw fa-stack-2x"></i>
<i class="fa fa-stack-1x">5</i>
</a>
</div>
</div>
</div>
CSS
.container-fluid .centered-vertically{
display:flex;
align-items:center;
}
Fiddle here

Here is a little Workaround with flexbox:
.posted-content {
border-radius: 4px;
border-color: #e7e7e7;
border: 1px solid rgba(0, 0, 0, 0.1);
max-width: 1140px;
background-color: #f8f8f8;
margin-bottom: 0px;
display:flex;
align-items: center;
justify-content: space-between;
}
.posted-content:before,.posted-content:after{
display:none;
}
.comment-action {
color: #79858A;
}
.comment-count>a {
text-decoration: none;
}
.comment-count>a:hover {
color: #d9534f !important;
}
JSFiddle

Related

How to create label on the top of image listing like Zomato in bootstrap 4

I'm trying to create a Zomato like restaurant listing in bootstrap. On your left-hand side is the bootstrap card that I created so far, and on the right which I want to implement.
But the problem is I don't know how to embed badges on the restaurant image like below.
Sorry to say but I'm not that much expert in bootstrap. Any guidance would be appreciated.
.featured-rating-green {
background: #46cd38 !important;
}
.featured-rating,
.featured-rating-orange,
.featured-rating-green {
position: absolute;
right: 10px;
width: 60px;
height: 60px;
text-align: center;
margin: -33px 10px 0 0;
font-size: 23px;
background: #ff7474;
color: #fff;
padding: 14px;
border-radius: 50%;
}
.featured-place-wrap {
background: #fff;
margin: 0 0 30px;
border: 1px solid #ccc;
-webkit-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
position: relative;
}
.border-upper-radius {
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.border-downer-radius {
border-bottom: 1px solid #bdbdbd;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
/**futer title box styling */
.featured-title-box {
padding: 22px 14px;
}
.featured-title-box h6 {
overflow: hidden;
white-space: nowrap;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
margin-bottom: 5px;
}
.featured-title-box p {
color: #9fa9b9;
display: inline-block;
margin: 0;
}
.featured-place-wrap a {
display: inline;
text-decoration: none;
color: #000;
}
.featured-title-box p span {
color: #ffb006;
padding: 0;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/all.min.css" rel="stylesheet" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/css/bootstrap.min.css" rel="stylesheet" />
<div class="row justify-content-center light-bg mt-3">
<div class="col-sm-6 col-lg-4 col-xl-4 featured-responsive">
<div class="featured-place-wrap border-upper-radius border-downer-radius">
<a href="#">
<img src="https://i.ibb.co/2v7vxmJ/FSox-Hdp-BY8fr-Oyb-D9c-NA.jpg" class="img-fluid border-upper-radius" alt="#">
<span class="featured-rating-green">5.0</span>
<div class="featured-title-box">
<h6>PJ’s Midway</h6>
<p>
1 Reviews </p>
<span> • </span>
<p>
<span>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i> </span>
</p>
<ul>
<li><span class="fas fa-map-marked-alt"></span>
<p data-toggle="tooltip" data-placement="top" title="" data-original-title="901 6 Ave E, Prince Rupert, BC V8J 1X7, Canada">901 6 Ave E, Prince Rupert, BC...</p>
</li>
<li><span class="fas fa-mobile"></span>
<p> +12506242100</p>
</li>
<li><span class="fas fa-biking"></span>
<p> $2.99 Approx</p>
</li>
</ul>
<div class="bottom-icons">
<div class="badge badge-pill badge-danger">CLOSE NOW</div>
</div>
</div>
</a>
</div>
</div>
</div>
You can use CSS to solve your problem by using the positions in your styles. Consider the tag where the photo is located as the parent tag and set its position as a relative value. Think of them in the picture as their children and give them an absolute apology and adjust the position of the children relative to their parent by giving the value to the top / bottom / right / left of the children.
For more information, refer to the following link:
CSS Layout - The position Property
div.relative {
position: relative;
width: 400px;
height: 200px;
border: 3px solid #73AD21;
}
div.absolute {
position: absolute;
top: 80px;
right: 0;
width: 200px;
height: 100px;
border: 3px solid #73AD21;
}
<div class="relative">This div element has position: relative;
<div class="absolute">This div element has position: absolute;</div>
</div>
You needed to clean image without label, your last image stretch, so, image label showing extra height also image.
you can set extra label any and it's positioned to image. here example:
update your html:
<div class='image-wrapper'>
<img src="https://i.ibb.co/2v7vxmJ/FSox-Hdp-BY8fr-Oyb-D9c-NA.jpg" class="img-fluid border-upper-radius" alt="#">
<p class="top-text">top text</p>
<p class="bottom-text">bottom label</p>
<p class="bottom-right-text">bottom label</p>
</div>
add new styles
.image-wrapper {
position: relative;
}
.image-wrapper .bottom-text,
.image-wrapper .bottom-right-text,
.image-wrapper .top-text {
position: absolute;
display: inline-block;
padding: 2px 5px;
background: #eee;
color: #000;
z-index: 2;
}
.image-wrapper .top-text {
background: gray;
top: 5px;
left: 5px;
}
.image-wrapper .bottom-right-text {
background: yellow;
bottom: 5px;
right: 5px;
}
.image-wrapper .bottom-text {
background: tomato;
bottom: 5px;
left: 5px;
}
.featured-rating-green {
background: #46cd38 !important;
}
.featured-rating,
.featured-rating-orange,
.featured-rating-green {
position: absolute;
right: 10px;
width: 60px;
height: 60px;
text-align: center;
margin: -33px 10px 0 0;
font-size: 23px;
background: #ff7474;
color: #fff;
padding: 14px;
border-radius: 50%;
}
.featured-place-wrap {
background: #fff;
margin: 0 0 30px;
border: 1px solid #ccc;
-webkit-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
position: relative;
}
.border-upper-radius {
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.border-downer-radius {
border-bottom: 1px solid #bdbdbd;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
/**futer title box styling */
.featured-title-box {
padding: 22px 14px;
}
.featured-title-box h6 {
overflow: hidden;
white-space: nowrap;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
margin-bottom: 5px;
}
.featured-title-box p {
color: #9fa9b9;
display: inline-block;
margin: 0;
}
.featured-place-wrap a {
display: inline;
text-decoration: none;
color: #000;
}
.featured-title-box p span {
color: #ffb006;
padding: 0;
}
.image-wrapper {
position: relative;
}
.image-wrapper .bottom-text,
.image-wrapper .bottom-right-text,
.image-wrapper .top-text {
position: absolute;
display: inline-block;
padding: 2px 5px;
background: #eee;
color: #000;
z-index: 2;
}
.image-wrapper .top-text {
background: gray;
top: 5px;
left: 5px;
}
.image-wrapper .bottom-right-text {
background: yellow;
bottom: 5px;
right: 5px;
}
.image-wrapper .bottom-text {
background: tomato;
bottom: 5px;
left: 5px;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/all.min.css" rel="stylesheet" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/css/bootstrap.min.css" rel="stylesheet" />
<div class="row justify-content-center light-bg mt-3">
<div class="col-sm-6 col-lg-4 col-xl-4 featured-responsive">
<div class="featured-place-wrap border-upper-radius border-downer-radius">
<a href="#">
<div class='image-wrapper'>
<img src="https://i.ibb.co/2v7vxmJ/FSox-Hdp-BY8fr-Oyb-D9c-NA.jpg" class="img-fluid border-upper-radius" alt="#">
<p class="top-text">top text</p>
<p class="bottom-text">bottom label</p>
<p class="bottom-right-text">bottom label</p>
</div>
<span class="featured-rating-green">5.0</span>
<div class="featured-title-box">
<h6>PJ’s Midway</h6>
<p>
1 Reviews </p>
<span> • </span>
<p>
<span>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i> </span>
</p>
<ul>
<li><span class="fas fa-map-marked-alt"></span>
<p data-toggle="tooltip" data-placement="top" title="" data-original-title="901 6 Ave E, Prince Rupert, BC V8J 1X7, Canada">901 6 Ave E, Prince Rupert, BC...</p>
</li>
<li><span class="fas fa-mobile"></span>
<p> +12506242100</p>
</li>
<li><span class="fas fa-biking"></span>
<p> $2.99 Approx</p>
</li>
</ul>
<div class="bottom-icons">
<div class="badge badge-pill badge-danger">CLOSE NOW</div>
</div>
</div>
</a>
</div>
</div>
</div>
Based on Ashish Yadav's answer, I added a div to put the 42min on the right side.
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/all.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/css/bootstrap.min.css" rel="stylesheet">
<div class="row justify-content-center light-bg mt-3">
<div class="col-sm-6 col-lg-4 col-xl-4 featured-responsive">
<div class="featured-place-wrap border-upper-radius border-downer-radius">
<a href="#">
<!-- removing image tag from here as we have to place ribbons ovwer the element, do i switced to div with background image -->
<div src="https://i.ibb.co/2v7vxmJ/FSox-Hdp-BY8fr-Oyb-D9c-NA.jpg" class="img-fluid border-upper-radius" alt="#" style="
background: url("https://i.ibb.co/2v7vxmJ/FSox-Hdp-BY8fr-Oyb-D9c-NA.jpg");
min-height: 300px;
background-size: cover;
position: relative;
">
<div style="
top:20px;
position: absolute;
color: black;
">
promoted
</div>
<div style="
position: absolute;
bottom: 20px;
">
<div style="
bottom: 20px;
background: red;
">Pro extra 10% off</div>
<div style="
margin-top: 10px;
background: blue;
">lorem ipsum</div>
</div>
<div style="
margin-top: 10px;
background: blue;
position: absolute;
right: 0;
bottom: 20px;
">42 min</div>
</div>
<span class="featured-rating-green">5.0</span>
<div class="featured-title-box">
<h6>PJ’s Midway</h6>
<p>
1 Reviews
</p>
<span> • </span>
<p>
<span>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i> </span>
</p>
<ul>
<li>
<span class="fas fa-map-marked-alt"></span>
<p data-toggle="tooltip" data-placement="top" title="" data-original-title="901 6 Ave E, Prince Rupert, BC V8J 1X7, Canada">901 6 Ave E, Prince Rupert, BC...</p>
</li>
<li>
<span class="fas fa-mobile"></span>
<p> +12506242100</p>
</li>
<li>
<span class="fas fa-biking"></span>
<p> $2.99 Approx</p>
</li>
</ul>
<div class="bottom-icons">
<div class="badge badge-pill badge-danger">CLOSE NOW</div>
</div>
</div>
</a>
</div>
</div>
</div>
Hi I have made a few changes in your HTML
like changing img tag to div with the background image.
For now, I have added inline CSS, you can put it in your CSS as per your usage
Read about CSS layout and position for further knowledge css positions and layouts
preview:
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/all.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/css/bootstrap.min.css" rel="stylesheet">
<div class="row justify-content-center light-bg mt-3">
<div class="col-sm-6 col-lg-4 col-xl-4 featured-responsive">
<div class="featured-place-wrap border-upper-radius border-downer-radius">
<a href="#">
<!-- removing image tag from here as we have to place ribbons ovwer the element, do i switced to div with background image -->
<div src="https://i.ibb.co/2v7vxmJ/FSox-Hdp-BY8fr-Oyb-D9c-NA.jpg" class="img-fluid border-upper-radius" alt="#" style="
background: url("https://i.ibb.co/2v7vxmJ/FSox-Hdp-BY8fr-Oyb-D9c-NA.jpg");
min-height: 300px;
background-size: cover;
position: relative;
">
<div style="
top:20px;
position: absolute;
color: black;
">
promoted
</div>
<div style="
position: absolute;
bottom: 20px;
">
<div style="
bottom: 20px;
background: red;
">Pro extra 10% off</div>
<div style="
margin-top: 10px;
background: blue;
">lorem ipsum</div>
</div>
</div>
<span class="featured-rating-green">5.0</span>
<div class="featured-title-box">
<h6>PJ’s Midway</h6>
<p>
1 Reviews
</p>
<span> • </span>
<p>
<span>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i> </span>
</p>
<ul>
<li>
<span class="fas fa-map-marked-alt"></span>
<p data-toggle="tooltip" data-placement="top" title="" data-original-title="901 6 Ave E, Prince Rupert, BC V8J 1X7, Canada">901 6 Ave E, Prince Rupert, BC...</p>
</li>
<li>
<span class="fas fa-mobile"></span>
<p> +12506242100</p>
</li>
<li>
<span class="fas fa-biking"></span>
<p> $2.99 Approx</p>
</li>
</ul>
<div class="bottom-icons">
<div class="badge badge-pill badge-danger">CLOSE NOW</div>
</div>
</div>
</a>
</div>
</div>
</div>

Vertical aligning items in CSS which are next to each other [duplicate]

This question already has answers here:
Align inline-block DIVs to top of container element
(5 answers)
Closed 1 year ago.
I have 2 icons in divs and 1 link which works as a button
.A {
width: 50px;
height: 50px;
border: 1px solid black;
display: inline-flex;
justify-content: center;
align-items: center;
margin: 5px;
}
a {
text-decoration: none;
}
.B {
width: 100px;
height: 50px;
}
/* when i change font-size for example to 10px then the element moves down a bit*/
.A span {
text-transform: uppercase;
color: black;
font-size: 10px;
}
<script src="https://kit.fontawesome.com/4254229804.js" crossorigin="anonymous"></script>
<a href="#">
<div class="A">
<i class="fab fa-facebook-f"></i>
</div>
</a>
<a href="#">
<div class="A">
<i class="fab fa-youtube"></i>
</div>
</a>
<a href="#">
<div class="A B">
<span>sign up</span>
</div>
</a>
here is a link to codepen https://codepen.io/hanzus/pen/GRrMbbm
Everything is centered when a font size of span element of "sign up" link is 16px, but when I change it for example to 10px then link moves a bit down and it is not on the same line with other divs with facebook and youtube links.
How do I get these links on the same line when I change a font-size of 1 element?
Wrap in flex:
.container {
display: flex;
}
<div class="container">
<a href="#">
<div class="A">
<i class="fab fa-facebook-f"></i>
</div>
</a>
<a href="#">
<div class="A">
<i class="fab fa-youtube"></i>
</div>
</a>
<a href="#">
<div class="A B">
<span>sign up</span>
</div>
</a>
</div>
Codepen
I know I am a bit a late to the party, but it is possible to make it simpler:
.container {
display: inline-flex;
width: 300px;
height: 50px;
}
.container a {
width: 33%;
margin: 5px;
border: 1px solid black;
display:inline-flex;
justify-content:center;
align-items:center;
font-size: 16px;
}
<div class="container">
<a href="#">
<i class="fab fa-facebook-f"></i>
</a>
<a href="#">
<i class="fab fa-youtube"></i>
</a>
<a href="#">
<span>sign up</span>
</a>
</div>
You should only add "flex-direction: column;" for your CSS code.
.container{
display: flex;
flex-direction: column;
}
.A {
width:50px;
height: 50px;
border: 1px solid black;
display:inline-flex;
justify-content:center;
align-items:center;
margin: 5px;
}
a {
text-decoration:none;
}
.B {
width: 100px;
height: 50px;
}
.A span {
text-transform: uppercase;
color:black;
font-size: 10px;
}

Customize icons with css

In the following code snippet I have some html and css code. What I want to do is to get a perfect white circle outside logos. Is anyone able to help me? I tried to do it by adding border to logo and making its radius 50% but it didn't worked out. It didn't get me a perfect circle.
h2 {
color: #fff;
font-size: 2rem;
text-align: center;
}
.my-skills {
background-color: #353353;
}
.skill-div {
display: inline-block;
width: 23%;
padding: 1%;
}
.skill-div i {
font-size: 7rem;
padding: 15%;
border: 2px solid #fff;
border-radius: 50%;
}
<!DOCTYPE html>
<html>
<head>
<!-- Fonts awesome link -->
<script src="https://kit.fontawesome.com/4e3ab997f9.js" crossorigin="anonymous"></script>
<head>
<section class="my-skills">
<h2>My skills</h2>
<div class="icon-collection">
<div class="skill-div">
<i class="fas fa-palette design-skill"></i>
<h4>Design</h4>
</div>
<div class="skill-div">
<i class="fab fa-html5 html-skill"></i>
<h4>HTML</h4>
</div>
<div class="skill-div">
<i class="fab fa-css3-alt css-skill"></i>
<h4>CSS</h4>
</div>
<div class="skill-div">
<i class="fab fa-js-square js-skill"></i>
<h4>JavaScript</h4>
</div>
</div>
</section>
</html>
As mentioned in my comment, to make that circle with border radius, you need to make sure the element is a square first, then your 50% border radius would be a circle instead of an oval
I added a div wrapper to the logos, class circle. The width and height is just a number I came up with to contain the logos. You can make small adjustments to the vertically longer logos if you want to further center them vertically.
I made the css logo lower with margin top to better vertically center it. Ideally these logos would be in a sprite and should be the same size so these micro adjustment won't be needed.
Alternatively, I made the html logo less in height which also vertically centers it better due to my use of flex. But again, it is better for everyone if these micro adjustment can be avoided
h2 {
color: #fff;
font-size: 2rem;
text-align: center;
}
.my-skills {
background-color: #353353;
}
.skill-div {
display: inline-block;
width: 24%;
padding: 1%;
}
.skill-div i {
font-size: 3rem;
}
.circle {
width: 60px;
height: 60px;
border: 1px solid white;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
}
.css-skill {
margin-top: 5px;
}
.html-skill {
height: 44px
}
<!DOCTYPE html>
<html>
<head>
<!-- Fonts awesome link -->
<script src="https://kit.fontawesome.com/4e3ab997f9.js" crossorigin="anonymous"></script>
<head>
<section class="my-skills">
<h2>My skills</h2>
<div class="icon-collection">
<div class="skill-div">
<div class="circle"><i class="fas fa-palette design-skill"></i></div>
<h4>Design</h4>
</div>
<div class="skill-div">
<div class="circle"><i class="fab fa-html5 html-skill"></i></div>
<h4>HTML</h4>
</div>
<div class="skill-div">
<div class="circle"><i class="fab fa-css3-alt css-skill"></i></div>
<h4>CSS</h4>
</div>
<div class="skill-div">
<div class="circle"><i class="fab fa-js-square js-skill"></i></div>
<h4>JavaScript</h4>
</div>
</div>
</section>
</html>
h2 {
color: #fff;
font-size: 2rem;
text-align: center;
}
.my-skills {
background-color: #353353;
}
.skill-div {
display: inline-block;
width: 23%;
padding: 1%;
}
.skill-div i {
width:7rem;
height:7rem;
font-size: 5rem;
display : flex;
align-items: center;
justify-content: center;
border : 2px solid white;
border-radius : 50%;
}
<!DOCTYPE html>
<html>
<head>
<!-- Fonts awesome link -->
<script src="https://kit.fontawesome.com/4e3ab997f9.js" crossorigin="anonymous"></script>
<head>
<section class="my-skills">
<h2>My skills</h2>
<div class="icon-collection">
<div class="skill-div">
<i class="fas fa-palette design-skill"></i>
<h4>Design</h4>
</div>
<div class="skill-div">
<i class="fab fa-html5 html-skill"></i>
<h4>HTML</h4>
</div>
<div class="skill-div">
<i class="fab fa-css3-alt css-skill"></i>
<h4>CSS</h4>
</div>
<div class="skill-div">
<i class="fab fa-js-square js-skill"></i>
<h4>JavaScript</h4>
</div>
</div>
</section>
</html>
Let's see its fine now

my div is overflowing though i applied overflow hidden

Please i have tried to look for solutions to this div but found none, I dont want my div to overflow and create a scroll. How can i adjust it that it wont overflow again.Thanks. My code is below
.contact-bar {
/*overflow: hidden;*/
}
.contact-top {
background-color: #1a1a1a;
border: 1px solid transparent;
padding: 5px;
}
.contact-top p {
margin: 0 20px;
color: white;
}
* {
margin:0;
padding:0;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row contact-bar">
<div class="col-xs-12 col-lg-6 col-md-6 col-sm-6 contact-top">
<p><i class="fa fa-phone"></i><span> </span><i class="fa fa-whatsapp"></i> +2347033501657</p>
</div>
<div class="col-xs-12 col-lg-6 col-md-6 col-sm-6 contact-top">
<p><i class="fa fa-envelope"></i> allamit#gmail.com</p>
</div>
</div>
Try to wrap row in a container or container-fluid as per your requirements
.contact-bar {
/*overflow: hidden;*/
}
.contact-top {
background-color: #1a1a1a;
border: 1px solid transparent;
padding: 5px;
}
.contact-top p {
margin: 0 20px;
color: white;
}
* {
margin:0;
padding:0;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid">
<div class="row contact-bar">
<div class="col-xs-12 col-lg-6 col-md-6 col-sm-6 contact-top">
<p><i class="fa fa-phone"></i><span> </span><i class="fa fa-whatsapp"></i> +2347033501657</p>
</div>
<div class="col-xs-12 col-lg-6 col-md-6 col-sm-6 contact-top">
<p><i class="fa fa-envelope"></i> allamit#gmail.com</p>
</div>
</div>
</div>
Working fiddle here
Remove the row and use the container. Hope it helps..
.contact-bar {
/*overflow: hidden;*/
}
.contact-top {
background-color: #1a1a1a;
border: 1px solid transparent;
padding: 5px;
}
.contact-top p {
margin: 0 20px;
color: white;
}
* {
margin:0;
padding:0;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container contact-bar">
<div class="col-xs-12 col-lg-6 col-md-6 col-sm-6 contact-top">
<p><i class="fa fa-phone"></i><span> </span><i class="fa fa-whatsapp"></i> +2347033501657</p>
</div>
<div class="col-xs-12 col-lg-6 col-md-6 col-sm-6 contact-top">
<p><i class="fa fa-envelope"></i> allamit#gmail.com</p>
</div>
</div>
overflow:hidden; applies hide to its childrens. But in this case it is you contact-barclass that wraps them all. So you need to apply overflow:hidden to the one that contains contact-bar which is body. By the way, you bootstrap applies -15px margin and thats why there is a gap in the example code of mine.
https://cr8code.co/editor.php?workid=e42b821765c82cdc32e457c79b638d35

Bootstrap 4 Uneven Buttons

I have some buttons in a bootstrap 4 list that I set to btn-block but for some reason the last one is a bit wider than the others. I'm not certain why since the CSS that has been added doesn't change the width or anything. Any clues? In the attached pic it's the Instagram button. Code will be below the image.
<header class="construction-header">
<div class="container">
<div class="construction-message">
<h1><img src="http://jessetoxik.com/img/header/logo/logo_temp.png"></h1>
<h3 class="fjalla">Webpage Coming Soon</h3>
<h3 class="release fjalla"></h3>
<hr class="construction-divider">
<ul class="list-inline construction-social-buttons fjalla">
<li class="list-inline-item">
<a href="https://example.com" class="btn btn-secondary btn-lg btn-drk btn-block">
<i class="fa fa-twitter fa-fw"></i>
<span class="network-name">Twitter</span>
</a>
</li>
<li class="list-inline-item">
<a href="https://www.example.com/" class="btn btn-secondary btn-lg btn-drk btn-block">
<i class="fa fa-facebook fa-fw"></i>
<span class="network-name">Facebook</span>
</a>
</li>
<li class="list-inline-item">
<a href="https://www.example.com" class="btn btn-secondary btn-lg btn-drk btn-block">
<i class="fa fa-instagram fa-fw"></i>
<span class="network-name">Instagram</span>
</a>
</li>
</ul>
</div>
</div>
</header>
body, html {
width: 100%;
height: 100%;
}
body, h1, h2, h3, h4, h5, h6 {
font-weight: 700;
text-shadow:
-1px -1px 0 #000,
1px -1px 0 #000,
-1px 1px 0 #000,
1px 1px 0 #000!important;
}
.construction-header {
padding-top: 50px;
padding-bottom: 50px;
text-align: center;
height: 100%;
color: #f8f8f8;
background: url('imagesrc') no-repeat center center;
background-size: cover;
}
.construction-message {
position: relative;
padding-top: 20%;
padding-bottom: 20%;
}
.construction-message>h1 {
margin: 0;
text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.6);
font-size: 5em;
}
.construction-divider {
width: 400px;
border-top: 1px solid #f8f8f8;
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}
.construction-message>h3 {
text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.6);
}
.construction-social-buttons i {
font-size: 80%;
}
#media(max-width:767px) {
.construction-message {
padding-bottom: 15%;
}
.construction-message>h1 {
font-size: 3em;
}
ul.construction-social-buttons>li {
display: block;
margin-bottom: 20px;
padding: 0;
}
ul.construction-social-buttons>li:last-child {
margin-bottom: 0;
}
.construction-divider {
width: 100%;
}
}
.btn-drk {
background-color: #232323!important;
}
Without seeing a working sample it's difficult to properly test. One alternative that I found was to use Bootstrap's Grid instead of .list-inline for arranging the buttons. It provides all of the flexibility of their displaying in a single row versus stacked based on the device width.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" type="text/css" rel="stylesheet">
<div class="container">
<div class="row">
<div class="col-12 col-sm-4 my-2">
<i class="fa fa-twitter fa-fw"></i><span class="network-name">Twitter</span>
</div>
<div class="col-12 col-sm-4 my-2">
<i class="fa fa-facebook fa-fw"></i><span class="network-name">Facebook</span>
</div>
<div class="col-12 col-sm-4 my-2">
<i class="fa fa-instagram fa-fw"></i><span class="network-name">Instagram</span>
</div>
</div>
</div>