Bird
Raised Fist0
HTMLmarkup~10 mins

Navigation structure basics in HTML - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a navigation bar using the correct HTML element.

HTML
<[1]>
  <a href="#home">Home</a>
  <a href="#about">About</a>
  <a href="#contact">Contact</a>
</[1]>
Drag options to blanks, or click blank then click option'
Anav
Bsection
Cdiv
Dheader
Attempts:
3 left
💡 Hint
Common Mistakes
Using
or
instead of
Not using a semantic element for navigation.
2fill in blank
medium

Complete the code to add a navigation list inside the nav element.

HTML
<nav>
  <ul>[1]</ul>
</nav>
Drag options to blanks, or click blank then click option'
A<p>Home</p><p>About</p><p>Contact</p>
B<li>Home</li><li>About</li><li>Contact</li>
C<div>Home</div><div>About</div><div>Contact</div>
D<a href="#home">Home</a><a href="#about">About</a><a href="#contact">Contact</a>
Attempts:
3 left
💡 Hint
5. You want to create a navigation bar that is accessible and responsive. Which combination of HTML and CSS practices is best?
hard
A. Use <header> only, no lists, and inline styles for positioning
B. Use <div> with <p> tags for links, no ARIA, and float for layout
C. Use <nav> with <span> for links, no semantic tags, and fixed widths
D. Use <nav> with a <ul> of links, add ARIA labels, and style with Flexbox for layout

Solution

  1. Step 1: Identify semantic HTML for navigation

    The <nav> element with a list (<ul>) of links is the correct semantic structure.
  2. Step 2: Accessibility and responsive layout

    Adding ARIA labels improves accessibility. Using Flexbox in CSS helps create a responsive layout that adapts to screen sizes.
  3. Final Answer:

    Use <nav> with a <ul> of links, add ARIA labels, and style with Flexbox for layout -> Option D
  4. Quick Check:

    Semantic + ARIA + Flexbox = best practice [OK]
Hint: Combine semantic tags, ARIA, and Flexbox for best navigation [OK]
Common Mistakes:
  • Using non-semantic tags for navigation
  • Ignoring accessibility with ARIA
  • Using outdated float instead of Flexbox
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard