This behavior is normal as specified in the CSS box model:
8.3.1 Collapsing margins
In this specification, the expression collapsing margins means that adjoining margins (no padding or border areas separate them) of two or more boxes (which may be next to one another or nested) combine to form a single margin.
In CSS2, horizontal margins never collapse.
Vertical margins may collapse between certain boxes:
Two or more adjoining vertical margins of block boxes in the normal flow collapse.
The resulting margin width is the maximum of the adjoining margin widths.
In the case of negative margins,
the absolute maximum of the negative adjoining margins is deducted from
the maximum of the positive adjoining margins.
If there are no positive margins,
the absolute maximum of the negative adjoining margins is deducted from zero.
Vertical margins between a floated box and any other box do not collapse.
Margins of absolutely and relatively positioned boxes do not collapse.
To achieve your goal you must set top and bottom padding to the parent element, the div in your case.
` are inline-block by default
– Mark May 15 '14 at 12:02