html - Strange behavior while using display inline-block ...why? -
html
<div class="menu"> <p>normal</p> </div> <div class="menu"> <p>normal</p> </div> <div class="menu"> <p>normal</p> </div> <div class="menu"> <p>why div stays @ top</p> </div>
css
.menu{ width:120px; background-color:red; display:inline-block; height:400px; }
i have 4 divs aligned next each other using inline-block. when enter text inside div using p tag, div 2 lines stays @ top while other 3 divs(has 1 line text) aligned properly.
help please..
add code vertical-align:top;
demo
Comments
Post a Comment