Suraj Suraj - 7 months ago 10
HTML Question

align li elements on right side

I have

li
like below in my code

<ul class="thumbnails-carousel clearfix" style="list-style:none;">
<li><img src="http://s2.postimg.org/h6uti3zud/1_tn.jpg" alt="1.jpg"></li>
<li><img src="http://s27.postimg.org/n4fjr7q2n/2_tn.jpg" alt="2.jpg"></li>
<li><img src="http://s29.postimg.org/afuhmf61f/3_tn.jpg" alt="3.jpg"></li>
<li><img src="http://s29.postimg.org/p45dxi6hf/4_tn.jpg" alt="4.jpg"></li>
</ul>


I want these images to be on the right hand side of each image instead of going below each other.

Answer

You can use float:left as well as display:inline-block

ul li{
  float:left;
}

OR

ul li{
  display:inline-block;
}
Comments