I have 3 divs on my web page horizontally next to eachother. Medium has a fixed size. I want the rest to fill in the remaining space on the page.
I made this snippet, which is a simplified version of my problem:
#left { background: red; float: left; } #middle { background: blue; margin-left: auto; margin-right: auto; width: 500px; } #right { background: green; float: right; }
<div id='right'>groen</div> <div id='left'>rood</div> <div id='middle'>fixed px blauw</div>
I cannot use percentages because the middle div has a fixed size.
left and right div should have a width (100%-1170px)/2
Is there an easy way to make css fill in the extra space? Or, if this is not an option, is there a way to do this programmatically?
source share