CSS Layout How to - Float image left








Question

We would like to know how to float image left.

Answer


<!DOCTYPE html>
<html>
<head>
</head><!--  w w  w  . jav a 2 s.  com-->
<body>
  <img src="http://dummyimage.com/150" style="float: left" />
  <ul style="float: left">
    <li>Item 1</li>
    <li>Item 2</li>
  </ul>
</body>
</html>

The code above is rendered as follows: