<?xml version="1.0" encoding="utf-8"?>

CSS display property with the inline-block value

CSS display property with the inline-block value Bad Practice
CSS display property with the inline-block value Best Practice

Inline-block elements took the best of two worlds. On the one hand, they behave like inline elements and can appear next to each other. On the other hand, inline-block elements form a box, and you can adjust their width and height, like block-level elements. The basic CSS syntax looks like this:

{

display:inline-block;

}

The display:inline-block and display:inline-flex are quite similar declarations, but they have one distinct difference. Flex items don't behave inline — the whole container does. In turn, inline-block elements aren't flexible and don't have the same height if the amount of content is different.

Improve your UX & Product skills with interactive courses that actually work