html5 - Aligning the bottoms of an img (float:left) and a nav (right:float) -
case: want 'main menu div'. needs logo on left, , horizontal nav bar on right.
.mainmenu { } #logo { float:left; } .menu { float:right; text-align:right; } .menu ul { list-style: none; padding:0; margin:0; } .menu ul li { display:inline; padding:1em; }
<div class="mainmenu clearfix"> <div id="logo"> <a href="home.html"><img src="img/logo.png"></a> </div> <div class="menu"> <nav> <ul> <li><a href="wat.html">what</a></li> <li><a href="who.html">who</a></li> <li><a href="contact.html">contact</a></li> </ul> </nav> </div> </div>
problem: nav bar in top right corner due float:right; want bottom right, aligned bottom of logo.
question: how in easiest possible way?
thank you
since want nav bar the bottom right of logo .. need clear first float
.mainmenu { } #logo { float:left; } .menu { float:right; text-align:right; } .menu ul { list-style: none; padding:0; margin:0; } .menu ul li { display:inline; padding:1em; } div.clear { clear:both; }
div class="mainmenu clearfix">
<div id="logo"> <a href="home.html"><img src="img/logo.png"></a> </div> <div class="clear"></div> <div class="menu"> <nav> <ul> <li><a href="wat.html">what</a></li> <li><a href="who.html">who</a></li> <li><a href="contact.html">contact</a></li> </ul> </nav> </div> </div>
Comments
Post a Comment