0
0
HTMLmarkup~20 mins

Clean HTML structure - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
HTML Structure Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Identify the semantic element for main content
Which HTML5 semantic element is best used to wrap the main content of a webpage for better structure and accessibility?
A<section>
B<main>
C<div>
D<article>
Attempts:
2 left
💡 Hint
Think about the element that clearly defines the primary content of the page.
📝 Syntax
intermediate
1:30remaining
Find the error in this HTML snippet
What is wrong with this HTML snippet?
<header>
  <h1>Welcome</h1>
  <nav>
    <ul>
      <li>Home</li>
      <li>About</li>
    </ul>
  </nav>
</header>
AThe first &lt;li&gt; tag is not closed properly.
BThe &lt;ul&gt; tag is missing a closing tag.
CThe &lt;nav&gt; element cannot be inside &lt;header&gt;.
DThe &lt;h1&gt; tag should be inside &lt;nav&gt;.
Attempts:
2 left
💡 Hint
Check if all tags have matching closing tags.
rendering
advanced
1:30remaining
What will the browser display?
Given this HTML code:
<section>
  <h2>Title</h2>
  <p>Paragraph 1</p>
  <p>Paragraph 2</p>
</section>

What will the browser show visually?
AParagraphs will appear before the heading.
BTwo headings 'Title' and 'Paragraph 1' with one paragraph 'Paragraph 2'.
COnly the heading 'Title' will display; paragraphs are hidden by default.
DA heading 'Title' followed by two separate paragraphs stacked vertically.
Attempts:
2 left
💡 Hint
Think about default block-level elements and their order.
selector
advanced
1:30remaining
CSS selector for all direct children
Which CSS selector targets only the direct child <article> elements inside a <main> element?
Amain > article
Bmain article
Cmain + article
Dmain ~ article
Attempts:
2 left
💡 Hint
The '>' symbol means direct child in CSS selectors.
accessibility
expert
2:00remaining
Best practice for accessible navigation landmarks
Which is the best way to make a navigation menu accessible and clearly identified by screen readers?
AUse a &lt;section&gt; element with a heading but no ARIA labels.
BUse a &lt;div&gt; with a class 'nav' and no ARIA attributes.
CUse a &lt;nav&gt; element with an aria-label describing the menu purpose.
DUse a &lt;nav&gt; element but hide it visually with CSS.
Attempts:
2 left
💡 Hint
Screen readers rely on landmarks and labels to identify page regions.