Looking to design a navigation menu with centered text and icons, while keeping the text aligned left to the icon? Want the link to adjust its width based on the container and also be responsive? Here's how:
How can you achieve this design?
https://i.sstatic.net/FD74o.jpg
HTML Code
<ul class="mobile-home-section">
<li><a href="#">PROPERTY</a></li>
<li><a href="#">FUTURE PLANNING</a></li>
<li><a href="#">COMMERICAL</a></li>
</ul>
CSS Styling
.mobile-home-section {
margin: 0;
padding: 0;
list-style-type: none;
width: 100%;
background: #163158;
}
.mobile-home-section li {
background-image: url('http://s18.postimg.org/m26o71ohx/icon_future_hover.png');
background-repeat: no-repeat;
background-position: 0 10px;
padding-left: 50px;
}
.mobile-home-section li a {
color: white;
text-decoration: none;
padding: 20px 0;
display: block;
border-bottom: 1px solid white;
}