CodePark/ questions / Display, positioning & stacking
START PRACTICINGPRACTICE
Frontend question · CSS & HTML › Display, positioning & stacking

You set width: 200px; height: 50px; on a span. For which display value are these sizes ignored?

inline

inline 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.