I have a dynamically generated menu, which resides in resizable container. There are 4 requirements that I have to comply:
<ul></ul>
list.Example:
> Item 1 | Item 2 | Item 3 | Item 4 | Item 5 | Item 6 | Item 7 <
Now, when container has shrunk down, itmes must form the following:
> Item 1 | Item 2 | Item 3 | Item 4 <
> | Item 5 | Item 6 | Item 7 <
The <
and >
signs represent container bounds.
How would I do that in HTML/CSS? Thanks in advance.
EDIT:
I forgot to mention that I have to use <ul>
and make it work under IE7+.
HTML:
<ul id="container">
<li class="item">Item1</li>
<li class="item">Item2</li>
<li class="item">Item3</li>
<li class="item">Item4</li>
<li class="item">Item5</li>
<li class="item">Item6</li>
<li class="item">Item7</li>
</ul>
CSS:
#container {
text-align: center;
padding: 10px;
}
.item {
display: inline-block;
margin: 0 8px;
/* for ie7 */
zoom: 1;
*display: inline;
}
Fiddle: http://jsfiddle.net/eqpGv/2/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With