Lists and Navigation

easy
By FrontendAtlas Editorial · Updated Oct 5, 2026
Build a semantic navigation bar using nav > ul > li > a with hash links. Use CSS :target to show only one section at a time without JavaScript, and ensure the Home section is visible by default when no hash is present.

Solution idea

Use an unordered list for the nav links and anchor each link to a section id. The CSS :target selector controls visibility: the targeted section is shown while others are hidden. Ordering matters so the default Home section remains visible when no hash exists, and becomes hidden when another section is targeted.