0
0
CSSmarkup~5 mins

Block vs inline vs inline-block in CSS - Quick Revision & Key Differences

Choose your learning style9 modes available
Recall & Review
beginner
What is a block-level element in CSS?
A block-level element takes up the full width available, starts on a new line, and can have width and height set. Examples include <div> and <p>.
Click to reveal answer
beginner
What is an inline element in CSS?
An inline element only takes up as much width as its content, does not start on a new line, and ignores width and height properties. Examples include <span> and <a>.
Click to reveal answer
intermediate
How does inline-block differ from inline and block elements?
Inline-block elements flow like inline elements (do not start on a new line) but can have width and height set like block elements.
Click to reveal answer
beginner
Which CSS property controls whether an element is block, inline, or inline-block?
The 'display' property controls this. For example, 'display: block;', 'display: inline;', and 'display: inline-block;'.
Click to reveal answer
intermediate
Why might you use inline-block instead of inline or block?
Use inline-block when you want elements to sit side by side but still control their size with width and height.
Click to reveal answer
Which element type starts on a new line and takes full width by default?
AInline-block
BInline
CNone of the above
DBlock
Which display value allows setting width and height but does not start on a new line?
Ainline-block
Binline
Cblock
Dnone
Which of these elements is inline by default?
A&lt;span&gt;
B&lt;div&gt;
C&lt;p&gt;
D&lt;section&gt;
What CSS property changes an element from inline to block?
Aposition
Bfloat
Cdisplay
Dvisibility
If you want elements side by side with control over size, which display value is best?
Ablock
Binline-block
Cflex
Dinline
Explain the differences between block, inline, and inline-block elements in CSS.
Think about how elements behave in a paragraph or a row.
You got /3 concepts.
    Describe a situation where using inline-block is better than block or inline.
    Imagine buttons or boxes in a row that need specific sizes.
    You got /3 concepts.