We help IT Professionals succeed at work.

All i want is display 2222 and 44444 like a table on right and left but it right goes on the second line?

goodk
goodk asked
on
CSS:
 .leftfloat
        {
             width:300px;
             background-color: red;
          float: left;
        }
        .rightfloat
        {
            clear: both;
              width:300px;
           background-color: blue;
            float: right;
        }



<div>
        <div class="leftfloat">
            2222
        </div>
        <div class="rightfloat">
            44444
        </div>
    </div>
Comment
Watch Question

Commented:
Try removing  the "clear:both;" from the right div.

Author

Commented:
thanks it worked, so what does the clear do?