The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Inline Behavior of an Element Reply To: Inline Behavior of an Element


Because padding on inline elements is kind quirky…adding increased the visual size but does nothing to affect the block context of the span…as such it doesn’t move. It’s in the CSS2 spec.

You can find a whole article on it at the important parts are:

The W3C’s CSS2 spec states that for Inline, non-replaced elements, the ‘height’ property doesn’t apply, but the height of the box is given by the ‘line-height’ property.

While padding can be applied to all sides of an inline element, only left and right padding will have an effect on surrounding content.

What’s wrong with inline-block…it seems to be exactly what you are looking for?