inlineinline is right. A span with display: inline is a non-replaced inline box. "Non-replaced" means its content is normal text in the page, not an outside resource like an image or a video. These boxes size to their content and ignore width and height. Their vertical padding also doesn't push the lines above and below apart.inline-block is the tempting wrong answer. It flows inline like text, but it respects width, height and vertical spacing. block and flex also respect both sizes.
Read more
- display (MDN) (https://developer.mozilla.org/en-US/docs/Web/CSS/display)developer.mozilla.org