CSS3 & Modern Layouts (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)
What is the difference between `inline`, `block`, and `inline-block`?
junior LevelcssBasic
In Simple Words:
block(<div>,<p>,<h1>): Starts on a new line and expands horizontally to fill the entire container width (100%). Respectswidth,height, margins, and padding.inline(<span>,<a>,<strong>): Flows inline within text without starting on a new line. Ignoreswidthandheight. Top/bottom margins and paddings do not push surrounding vertical lines away.inline-block(<img>,<button>,<input>): Flows inline with surrounding text (does not break onto a new line), but respectswidth,height, vertical margins, and padding.