CSS3 Solution
Using some @media query calls (so there is a practical limit to how big can go) gives good results in CSS3 browsers. See this script ( full screen ) that uses this (example only) code:
HTML
<ul class="container"> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul>
CSS
@media screen and (min-width: 122px) { .container {width: 120px;} } @media screen and (min-width: 242px) { .container {width: 240px;} } @media screen and (min-width: 362px) { .container {width: 360px;} } @media screen and (min-width: 482px) { .container {width: 480px;} } @media screen and (min-width: 602px) { .container {width: 600px;} } .container { margin: 10px auto; overflow: hidden; border: 1px solid red; height: 210px; } li { width: 100px; height: 50px; background: cyan; float: left; margin: 10px; }
It is also possible that you or other users might find this useful .
source share