Back to Developer Roadmap

Block Inline Elems

src/data/question-groups/frontend/content/block-inline-elems.md

4.0691 B
Original Source

In CSS, the difference between inline, inline-block, and block elements is on the way they’re rendered in the web page:

  • Inline: Inline elements don’t have a width or height. Instead, they don’t start on a new line and take up only the width that’s required (based on their content). Examples: <span>, <a>.
  • Inline-block: Just like inline elements, here the DOM elements do not start on a new line, however, they do allow you to set a height and width on them. Example: <img>.
  • Block: Elements start on a new line, taking up the full width available by default. Their width and height can be set by you. Examples: <div>, <p>.