HTML CSS JavaScript SEO Python Posts Privacy About Contact

CSS Inline-block

The display: inline-block allows to set a width and height on the element.

Compared to display: inline, the major difference is that display: inline-block allows to set a width and height on the element. Also, with display: inline-block, the top and bottom margins/paddings are respected.

Compared to display: block, the major difference is that display: inline-block does not add a line-break after the element, so the element can sit next to other elements.

Preview

One common use for display: inline-block is to display list items horizontally instead of vertically.

Preview