Suppose you have n floating divs in a container. How do you make space between them (margin) to be equal, automatically? it should support window resize event.
I can use JQuery if needed, but I'd rather it to be pure html/css. Thanks
Suppose you have n floating divs in a container. How do you make space between them (margin) to be equal, automatically? it should support window resize event.
I can use JQuery if needed, but I'd rather it to be pure html/css. Thanks
Easy! justify them! (using only CSS)
Note: Don't float them, floating is the LAST thing you should do in many cases.
Here's an example: DEMO PAGE
<ul>
<li>item 1</li>
<li>item 2</li>
<li>another item</li>
<li>and another</li>
</ul>
ul{ width:100%; text-align:justify; }
ul::after{ content:''; display:inline-block; width:100%; }
ul li{ display:inline-block; }