html - Fill remaining space between two inline-blocks with another inline-block -
i have 3 divs. each of them inline-block. left 1 floats left. right 1 floats right. middle 1 floats right too. outer divs have fixed widths. want is, middle div fills whole space between other divs. can't specify width, because should work every width of screen. here's code.
<div id="wrapper"> <div id="right"></div> <div id="middle"></div> <div id="left"></div> </div> #wrapper { width: 100%; } #left { float: left; width: 50px; } #right { float: right; width: 50px; } #middle { float: right; }
you need remove float:right; on #middle , put after #left , #right in html markup.
see fiddle
html :
<div id="wrapper"> <div id="right"></div> <div id="left"></div> <div id="middle"></div> </div> css
#wrapper { width: 100%; } #left { float: left; width: 50px; } #right { float: right; width: 50px; }
Comments
Post a Comment