Utilizing Bootstrap, I have created the following footer:
.align-center {
text-align: center;
}
#footer {
background-color: #3c3d41;
color: white;
padding-top: 25px;
padding-bottom: 10px;
}
.footer-social-media-text {
text-decoration: none;
height: 25px;
color: white;
white-space: nowrap;
}
.footer-social-media-icon {
padding-right: 8px;
margin-left: 30px;
margin-right: 2px;
font-weight: bold;
height: 25px;
color: white;
}
#footer a {
-o-transition: .25s;
-ms-transition: .25s;
-moz-transition: .25s;
-webkit-transition: .25s;
transition: .25s;
}
#footer a:hover {
text-decoration: none;
color: greenyellow;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<footer id="footer">
<div class="container">
<div class="row">
<div class="col-md-3">
<a href="https://www.mycompany.com/" class="footer-social-media-text">
<i class="fa fa-home fa-2x social footer-social-media-icon"></i> My Company
</a>
</div>
<div class="col-md-9">
<a href="https://www.facebook.com" class="footer-social-media-text pull-right">
<i class="fa fa-facebook fa-2x social footer-social-media-icon"></i> Facebook
</a>
<a href="https://www.instagram.com" class="footer-social-media-text pull-right">
<i class="fa fa-instagram fa-2x social footer-social-media-icon"></i> Instagram
</a>
<a href="https://twitter.com" class="footer-social-media-text pull-right">
<i class="fa fa-twitter fa-2x social footer-social-media-icon"></i> Twitter
</a>
</div>
</div>
<hr />
<p class="align-center">© 2017 My Company</p>
</div>
</footer>
</div>
</div>
https://jsfiddle.net/coyagf2b/
The challenge I am facing with the above code is that the width thresholds of <div class="col-md-3">
and <div class="col-md-9">
in the bootstrap grid do not align with my desired layout.
Specifically, here's what I want to achieve:
- Ensure the right part stacks below the left part when the page width is significantly reduced. I have experimented with different combinations of
col-md-x
,col-lg-x
,col-sm-x
without success. - Change the content alignment of both parts to center when the right part stacks below.
How can I accomplish this?