Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text in inline-block div pushing it down [duplicate]

Tags:

html

css

I discovered a strange CSS problem this morning and I'm hoping the CSS experts can help me out. In this demo, why is the text in the red div pushing it down? I expected that the two divs would be next to each other. Thanks!
EDIT: Thanks guys for the answers. I will accept an answer in a bit. Can anyone explain why this is happening?

like image 826
Abraham Avatar asked Oct 10 '12 11:10

Abraham


1 Answers

...........................

Hi now used to vertical-align: top;

div {
    display: inline-block;
    height: 50px;
    width: 50px;
    vertical-align: top;
}

Demo

like image 67
Rohit Azad Malik Avatar answered Nov 15 '22 22:11

Rohit Azad Malik