Skip to main content
InterviewHubPRO
Section Overview
Q4

Question 4 of 50

Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

8%
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%). Respects width, height, margins, and padding.
  • inline (<span>, <a>, <strong>): Flows inline within text without starting on a new line. Ignores width and height. 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 respects width, height, vertical margins, and padding.