Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why the space between divs when using display: inline-block [duplicate]

Tags:

css

Why is an empty space between divs when using display: inline-block, like in this example: http://jsbin.com/IhULuZO/1/edit.

I know I can use float:left, but I want to get rid of the empty space without floating elements if possible.

like image 315
Tamás Pap Avatar asked Dec 16 '22 04:12

Tamás Pap


1 Answers

Because the indentation of your code technically is a bunch of whitespace.

<div class="parent">
    <div class="child"></div><div class="child"></div><div class="child"></div>
</div>
like image 67
nicks Avatar answered Feb 01 '23 23:02

nicks