Display list items in rows

HTML lists allow web developers to group a set of related items in lists.

Normally,items in a list are displayed vertically : one below the other.

We can display list items in row by setting the styles of list items.

<!DOCTYPE html>
<html>
<body>

<h2>Jobin and Jismi ECommerce</h2>

<ul>
  <li>HTML</li>
  <li>css</li>
  <li>javascript</li>
   <li>php</li>
</ul>  

 <h2>Jobin and Jismi ECommerce In rows</h2>
 <style>
 #ulRow{
 display: flex;
 flex-direction: row;
 flex-wrap: wrap;
 columns: 2
 }
 .liRow{
 width:50%;
 
 }
 </style>

<ul id="ulRow">
  <li class="liRow">HTML</li>
  <li class="liRow">css</li>
  <li class="liRow">javascript</li>
   <li class="liRow">php</li>
</ul>  

</body>
</html>

Result

Leave a comment

Your email address will not be published. Required fields are marked *