How can I use vertical-align as well as float in div properties? vertical-align works fine if I don't use float . But if I use float then this will not work. It is important for me to use float:right for the last div.
I am trying to follow if you remove the float from all divs, then it will work fine:
<div class="wrap"> <div class="left">First div, float left, has more text.</div> <div class="left2">Second div, float left </div> <div class="right">Third div, float right</div> </div>
CSS
.wrap{ width: 500px; overflow:hidden; background: pink; } .left { width: 150px; margin-right: 10px; background: yellow; float:left; vertical-align: middle; display:inline-block } .left2 { width: 150px; margin-right: 10px; background: aqua; float:left; vertical-align: middle; display:inline-block } .right{ width: 150px; background: orange; float:right; vertical-align: middle; display:inline-block }
Jsfiddle
html css vertical-alignment
user1355300 Jul 30 2018-12-12T00: 00Z
source share