float: ***;

  • IE
  • Cr
  • Sf
  • Fx
  • O

The float property creates a floating box.

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

li {
float: left;

Property Value Explanation
float left the box floats to the left
right the box floats to the right


<title>TAG index</title>

<style type="text/css">

ul {
padding: 0;
margin: 0;
list-style-type: none;

li {
float: left;
width: 150px;
margin-right: 5px;
padding: 2px;
border: 1px #ffb366 solid;
background-color: #fffdee;
text-align: center;




<p style="clear: left;">--- Clears the left float ---</p>


  • First
  • Second
  • Third

--- Clears the left float ---