Why is there an unexplainable gap between these inline-block div elements? [duplicate]

I have two inline-block div elements, that are the same, positioned next to eachother. However there seems to be a mysterious space of 4 pixels between the two divs despite the margin being set to 0. There are no parent divs effecting them – What is going on?

CSS

#container
{
    display:inline-block;
    position:relative;
    background:rgb(255,100,0);
    margin:0px;
    width:40%;
    height:100px;
}

Div problem

This is what i want it to look like:

What it SHOULD look like

6 Answers
6

Leave a Comment