Challenge - 5 Problems
Nested Elements Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate2:00remaining
What is the visual output of nested and elements?
Consider this HTML code snippet:
What will the browser display?
<section>
<article>
<h2>Title</h2>
<p>Paragraph inside article.</p>
</article>
<p>Paragraph inside section but outside article.</p>
</section>What will the browser display?
HTML
<section> <article> <h2>Title</h2> <p>Paragraph inside article.</p> </article> <p>Paragraph inside section but outside article.</p> </section>
Attempts:
2 left
💡 Hint
Remember that nested elements inside and are all displayed unless hidden by CSS or scripts.
✗ Incorrect
The contains an with a heading and paragraph, plus another paragraph outside the article but inside the section. All these elements render in order.
❓ selector
intermediate2:00remaining
Which CSS selector targets only paragraphs inside elements nested in ?
Given this HTML structure:
Which CSS selector will style only the paragraph inside the?
<section>
<article>
<p>Text 1</p>
</article>
<p>Text 2</p>
</section>Which CSS selector will style only the paragraph inside the
Attempts:
2 left
💡 Hint
Think about the full path from section to article to paragraph.
✗ Incorrect
The selector 'section article p' targets paragraphs inside articles that are inside sections. 'section > p' targets paragraphs directly inside section, not inside article.
🧠 Conceptual
advanced2:00remaining
What is the semantic meaning of nesting
Why would a developer nest a
Attempts:
2 left
💡 Hint
Think about how HTML5 elements describe the page structure and help assistive technologies.
✗ Incorrect
Nesting
❓ layout
advanced2:00remaining
How does nesting
elements affect CSS Flexbox layout?
Given this HTML:
With CSS:
Which boxes will be arranged side by side by Flexbox?
<div class="container">
<div class="box">Box 1</div>
<div class="wrapper">
<div class="box">Box 2</div>
</div>
</div>With CSS:
.container { display: flex; }Which boxes will be arranged side by side by Flexbox?
HTML
<div class="container"> <div class="box">Box 1</div> <div class="wrapper"> <div class="box">Box 2</div> </div> </div>
Attempts:
2 left
💡 Hint
Flexbox arranges direct children of the flex container only.
✗ Incorrect
Flexbox applies only to direct children of the container. 'Box 1' and 'wrapper' are direct children; 'Box 2' is nested inside 'wrapper' and not a flex item.
❓ accessibility
expert3:00remaining
Which nested HTML structure best supports screen reader navigation?
Choose the HTML snippet that uses nested semantic elements correctly to help screen readers understand page sections and navigation.
Attempts:
2 left
💡 Hint
Screen readers rely on semantic tags and ARIA labels to understand page structure.
✗ Incorrect
Option C uses semantic elements ,