sets horizontal list by using the display property


display: inline;

Browser
Internet Explorer Firefox Opera

The display property changes the display type of an element.

When you apply this property to the LI element, the horizontal list can be created.


li {
display: inline;
}


Property Value Explanation
display inline the element is displayed as an inline element

Example

<html>
<head>
<title>TAG index</title>

<style type="text/css">

li {
display: inline;
margin-right: 20px;
}

</style>

</head>
<body>

<ul>
<li>First</li>
<li>Second</li>
<li>Third</li>
</ul>

</body>
</html>
Output
  • First
  • Second
  • Third