0
0
HTMLmarkup~20 mins

Block-level elements in HTML - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Block-level Elements Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Identify the block-level element
Which of the following HTML elements is block-level by default?
A<div>
B<span>
C<img>
D<a>
Attempts:
2 left
💡 Hint
Block-level elements usually start on a new line and take full width.
📝 Syntax
intermediate
1:30remaining
Which code produces a block-level layout?
Given this HTML snippet, which option will make the <section> behave as a block-level element?
HTML
<section style="display: ???">Content</section>
Ablock
Binline
Cinline-block
Dnone
Attempts:
2 left
💡 Hint
Block-level elements take full width and start on a new line.
rendering
advanced
2:00remaining
Visual output of nested block-level elements
What will be the visual layout of this HTML in a browser?
HTML
<div style="background:#cce; padding:1rem;"><p style="background:#eef; margin:0.5rem;">Hello</p><p style="background:#eef; margin:0.5rem;">World</p></div>
AParagraphs overlapping inside the blue box
BTwo paragraphs stacked vertically inside a blue box with spacing around each paragraph
CTwo paragraphs side by side inside a blue box with no spacing
DOnly one paragraph visible inside the blue box
Attempts:
2 left
💡 Hint
Block-level elements stack vertically and respect margin and padding.
selector
advanced
2:00remaining
CSS selector for block-level elements
Which CSS selector will select all block-level elements inside a container with id 'content'?
A#content > *:not(span):not(a):not(img)
B#content block
C#content *:block
D#content > div, #content > p, #content > section, #content > article
Attempts:
2 left
💡 Hint
There is no CSS pseudo-class for block-level elements; you must list them explicitly.
accessibility
expert
2:30remaining
Accessibility impact of block-level elements
Why is it important to use semantic block-level elements like <article> or <section> instead of generic <div> for page structure?
AIt automatically changes the font size for better readability
BIt improves the page loading speed significantly
CScreen readers can better understand and navigate the page structure
DIt prevents users from copying the content
Attempts:
2 left
💡 Hint
Think about how assistive technologies interpret page content.