The biggest feature of the footer is our social icons. Font Awesome to the rescue!
Consulting the Font Awesome documentation, we find a slew of available icons under the category of Brand Icons. Here is the direct link:
http://fortawesome.github.io/Font-Awesome/icons/#brand
Now, we only need to replace the text for each social link in our footer with span elements, using the appropriate classes.
<ul class="social"> <li><a href="#" title="Twitter Profile"><span class="icon fa fa-twitter"></span></a></li> <li><a href="#" title="Facebook Page"><span class="icon fa fa-facebook"></span></a></li> <li><a href="#" title="LinkedIn Profile"><span class="icon fa fa-linkedin"></span></a></li> <li><a href="#" title="Google+ Profile"><span class="icon fa fa-google-plus"></span></a></li> <li><a href="#" title="GitHub Profile"><span class="icon fa fa-github-alt"></span></a></li> </ul>
This updated markup puts our icons in place:
Now, perform the following steps to lay them out horizontally and align them to the center.
_footer.less
to manage these styles.less
directory.__main.less
.// Other custom files
@import "_page-contents.less";
@import "_footer.less";
Now, we'll write the styles we need. Let me simply lay them out, and then list what they do.
The lines that we'll need are given as follows:
ul.social { margin: 0; padding: 0; width: 100%; text-align: center; > li { display: inline-block; > a { display: inline-block; font-size: 18px; line-height: 30px; .square(30px); // see bootstrap/mixins.less border-radius: 36px; background-color: @gray-light; color: #fff; margin: 0 3px 3px 0; &:hover { text-decoration: none; background-color: @link-hover-color; } } } }
Here's what's happening:
ul
bootstrap/mixins.less
, search for .square
, and you'll find the following relevant lines:// Sizing shortcuts .size(@width; @height) { width: @width; height: @height; } .square(@size) { .size(@size; @size); }
border-radius
property is set large enough to make the icons and their backgrounds appear circularWith these steps accomplished, let's polish off the footer by adding a healthy bit of top and bottom padding, and then center aligning the content in order to move our logo to the center above the social icons.
footer[role="contentinfo"] { padding-top: 24px`; padding-bottom: 36px; text-align: center; }
The result is as follows:
Not bad—if I don't say so myself!