Why dont DIVs with display in-line block seat next to each other with width 50%

The negative margin hack is not a reliable method to remove the node, in fact it just drags the div on top of the node.

It is prone to fail when the user’s base font-size is unknown.

The more reliable method in the past was to use word-spacing to kill the node. But there is a long standing Webkit bug that makes that method fail in Chrome. The workaround to make webkit behave was display:table

See the CSS Quiz # 35 - inline-block for the cross browser solution in 2010’

But there is no need to go down that road now in 2018’ with old IE gone. As mentioned earlier display:table or display:flex can be used when the whitespace nodes cause problems for a layout.

There are plenty of times when the nodes are not an issue, such as with gallery images. In a case like that I would have no problem using inline-blocks. :grinning:

3 Likes