To make the built-in use of " display:inline:block property", this should solve both problems: 1) is approaching 2) It also gives the distance between the elements
But if you think that all objects can have different heights, I would recommend using " vertical-align:top " and with it " margin-bottom:5px " to give a space, since vertical-align:top removes the space between the lines .
here is the code: -
HTML:
<ul> <li style="height:110px;"></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></li> <li></li> <li></li> </ul>
CSS
li { display: inline-block; width:200px; height:100px; border:1px solid; vertical-align:top; margin-bottom:5px; }
You can refer to Fiddle here: - http://jsfiddle.net/aasthatuteja/2Uygc/
Please let me know if this solves your problem.
Enjoy it!
source share