Removing the whitespace from inline block elements
There are two common methods of building a horizontal component, such as navigation: using floats; or setting the display
property to inline-block
. This latter approach makes child elements run in to the same horizontal line in the document flow but preserves their block behaviour, and is pretty effective because you don’t have to worry about clearing floats as you would in the alternative technique. It does, however, have a drawback.