I am struggling to set up a top menu bar using float: left
. How can I achieve the desired behavior for a top menu bar? The code snippet below demonstrates what I have tried so far:
* { margin:0; padding: 0; }
#menu { background-color: yellow; }
#left {background-color: green; width: 200px; }
#mid { background-color: red; width: 40%; float: left; }
#right {background-color: blue; float: left; }
<div id="menu">
<div id="left">left green: 200px</div>
<div id="mid">mid red: 40% of browser width</div>
<div id="right">right blue: rest</div>
</div>
<div>
content of the site
</div>