user1490674
user1490674

Reputation:

Why is this CSS playing up?

I have a very basic container with a few children divs inside, displayed as inline-block. All works well until I actually insert content into the children divs. When I have content in them, they seem to move down, for no apparent reason.

Here is the fiddle of it all working well.

And here is the fiddle with it all messing up (with the content).

Can someone please tell me why this is happening and how to solve it?

I've been at it for hours but cant seem to figure it out. Any help is much appreciated.

Upvotes: 4

Views: 63

Answers (2)

Niet the Dark Absol
Niet the Dark Absol

Reputation: 324620

Add vertical-align:top to the boxes.

Upvotes: 0

Petah
Petah

Reputation: 46050

Instead of using display: inline-block use display: block; float: left;

http://jsfiddle.net/GtPWX/2/

Or you could set vertical-align: top on the boxes.

Upvotes: 1

Related Questions