What is the difference between Float:left vs Display:inline? While every element in browser goes to left by default

display:inline means a element is will "stack" next to other items, like images, spans or the bold tag. This is opposed by block level elements (display:block) which take up horizontal space, imply a line break, and will not sit next to one another, like divs, paragraphs, or tables.

Think of it this way...

<img /><img /><img />

<div />
<div />
<div />

float is a different notion altogether, moving content either left or right. By default, a floated element is inline, and floated elements will stack up next to one another.

All of these types of elements are part of the normal document flow, meaning they take up "space" in the design that cannot be shared.


There are two types of formatting: block level and inline. The block level formatting is done with a box model that uses a set of rules for layout.

Inline formatting is what text normally gets. It means, informally, that things are filled into lines.

At times, you want to change the default formatting an item will get. Something that normally might be block level formatted you might want to have treated as inline. A div containing content such as graphic of a key, for example, might need to be displayed within a sentence. One might then override its formatting with display:inline. Images are already displayed "Inline"

The CSS specification has a surprisingly simple definition for floats:

A float is a box that is shifted to the left or right on the current line. The most interesting characteristic of a float (or "floated" or "floating" box) is that content may flow along its side

So a float is a sort of third category of formatting model. It relates to inline as being, informally put, a layout model.


Although it's too late to answer, but one of the major differences that I can mentioned here is about: Clear

In float elements you should Clear your floats but in inline elements no clearing is required.

You can see a live example here: http://jsfiddle.net/K9PXF/

And this a great article about floats and clearing: http://css-tricks.com/all-about-floats/