Make sure you specify an external container by specifying a div or fixed-width section, and try to place the image container inside it to achieve this.
<div id="outer-container" style="width:800px;height:400px;"> <div id="image-container" style="float:left;width:100;margin-right:10px;margin-bottom:10px;"> <img src="your_image_src" width="100" height="100"/> </div> <div id="image-container" style="float:left;width:100;margin-right:10px;margin-bottom:10px;"> <img src="your_image_src" width="100" height="100"/> </div> <div id="image-container" style="float:left;width:100;margin-right:10px;margin-bottom:10px;"> <img src="your_image_src" width="100" height="100"/> </div> </div>
You can use display: inline-block instead of float: left to achieve it.but display: the inline block can be used based on your situation.
source share