Place divs around a centered div in CSS -
i have 3 divs. 'middle' div needs centered in containing element (a seperate div width of page, basically) while other 2 divs should on either side of 'middle' div.
here i've tried far, can see, if left , right divs aren't in width, push 'middle' div off center.
<div class='cont'> <div class='name2'>the man 6 fingers</div> <div class='vs'>vs.</div> <div class='name1'>i. montoya</div> </div> .cont{ position:fixed; top:0px; width:100%; background-color:red; text-align:center; } .cont >div{ display:inline-block; }
the solution needs work in webkit since in mobile app.
i adjusted widths, min-width, , white space tweak responsiveness. you're looking for?
see demo
.name1, .name2 { width:30%; min-width:160px; white-space:nowrap; }
Comments
Post a Comment