It's a silly question, but I can't vertically align the icons on the navigation with the text. I am trying to align them at the bottom, but anything works.
I can make it work if I give a height to the <li>
elements, but I've been told it has to be "natural", so I can not give a height to the <li>
elements. I could do it with position:relative and giving it some pixels for the top, but again, I've been told it should be "more natural", not giving specific number of pixels for the top....
I have look for possible solutions around old post and some say to use display-block and then vertical alignment, but it doesn't work.
Can someone see what I'm doing wrong?
Thank you
Here a jsfiddle: http://jsfiddle.net/3uwzcspn/
html:
<div class="" id="">
<ul class="nav navbar-nav">
<li>
<a href="">
<img src="http://s18.postimg.org/86tb8kv1h/icon1.png" alt=""/>
<span>Manufracturer<span> </span>Approved</span></a>
</li>
<li>
<a href="">
<img src="http://s11.postimg.org/aola8nkdr/icon2.png" alt=""/>
<span>Customer 1st<span> </span>We'll visit you</span></a>
</li>
<li>
<a href="">
<img src="http://s30.postimg.org/5e6fr1p99/icon3.png" alt=""/>
<span>Excess<span> </span>SAFE</span></a>
</li>
<li>
<a href="">
<img src="http://s30.postimg.org/a2mfm8efx/icon4.png" alt=""/>
<span>Friendly Form- <span> </span>Free Help</span></a>
</li>
<li>
<a href="">
<img src="http://s13.postimg.org/t1bjf5eur/icon5.png" alt=""/><span>FREE-<span> </span>Accident Management</span></a>
</li>
</ul>
</div>
</div>
</nav>
css:
body {
font-family:'Droid Sans', sans-serif;
}
/*unwanted default Bootstrap*/
.navbar-collapse{
padding:0;
margin:0;
}
.navbar-nav {
width:100%;
float:none;
/*displaying inline block makes a little margin*/
margin-top: 0.2%;
margin-bottom: 0.1%;
}
.navbar-default {
border:none;
margin-bottom: 0;
border-radius:0;
box-shadow:none;
background:none;
}
.navbar-brand {
padding:0;
}
/**Top Navigation**/
.wrapperOrg {
background: #f9540a;
}
#topNavigation {
background: #f9540a;
font-weight:700;
font-size:1.2em;
}
#topNavigation li {
border-right:2px solid #d93700;
box-shadow: 1.5px -0.5px 0px -0.5px rgba(255, 255, 250, 0.5);
-webkit-box-shadow: 1.5px -0.5px 0px -0.5px rgba(255, 255, 250, 0.5);
-moz-box-shadow: 1.5px -0.5px 0px -0.5px rgba(255, 255, 250, 0.5);
}
#topNavigation li a {
color: #fff;
padding: 3%;
}
#topNavigation .navbar-nav li a:hover {
color: #808080;
}
#topNavigation li a img {
float: left;
clear: left;
display:inline-block;
vertical-align:bottom;
}
#topNavigation li a span {
display:inline-block;
}
#topNavigation li a span:last-child {
display:block;
}
/*for better responsive*/
#topNavigation li:first-child {
width:21%;
}
#topNavigation li:nth-child(2){
width:19%;
}
#topNavigation li:nth-child(3){
width:13%;
}
#topNavigation li:nth-child(4){
width:20%;
}
#topNavigation li:last-child {
width:27%;
border:none;
box-shadow: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
}