I'm designing a simple top-menu with a logo on the left, and inline-links on the right:
* { margin:0; padding: 0; }
#header { background-color: grey; }
#right { background-color: blue; float:right; }
#left { background-color: green; float:left; }
li { display:inline-block; padding: 0 30px; }
<div id="header">
<div id="left">LOGOLOGOLOGOLOGOLOGOLOGO</div>
<div id="right">
<ul>
<li>Link 1</li>
<li>Link 2</li>
<li>Link 3</li>
<li>Link 4</li>
</ul>
</div>
</div>
I would like that :
when the browser width is enough for everything to be inline, the links-list should be aligned on the right (
float: right
)when the browser width is not enough for everything to be inline, the links-list should be aligned on the left
How to do it with my code mentioned before?
Note: I would like the "wrap effect" to appear exactly when
width(#left)+width(#right)>width(browser)
and not with something static like width(browser)<300px
.