Challenge - 5 Problems
Block-level Elements Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
Identify the block-level element
Which of the following HTML elements is block-level by default?
Attempts:
2 left
💡 Hint
Block-level elements usually start on a new line and take full width.
✗ Incorrect
The <div> element is block-level, meaning it starts on a new line and stretches across the container. <span>, <img>, and <a> are inline elements by default.
📝 Syntax
intermediate1: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>
Attempts:
2 left
💡 Hint
Block-level elements take full width and start on a new line.
✗ Incorrect
Setting display to 'block' makes the element block-level. 'inline' and 'inline-block' keep it inline, and 'none' hides it.
❓ rendering
advanced2: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>
Attempts:
2 left
💡 Hint
Block-level elements stack vertically and respect margin and padding.
✗ Incorrect
The <div> is a block container with padding and background color. The <p> elements are block-level and stack vertically with margin spacing.
❓ selector
advanced2:00remaining
CSS selector for block-level elements
Which CSS selector will select all block-level elements inside a container with id 'content'?
Attempts:
2 left
💡 Hint
There is no CSS pseudo-class for block-level elements; you must list them explicitly.
✗ Incorrect
Option D lists common block-level elements explicitly. Option D excludes some inline elements but is incomplete. Options B and C are invalid selectors.
❓ accessibility
expert2: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?
Attempts:
2 left
💡 Hint
Think about how assistive technologies interpret page content.
✗ Incorrect
Semantic block-level elements provide meaning to the page structure, helping screen readers and other assistive tools navigate and understand content better. The other options are incorrect or unrelated.