This page has a navigation menu with links that jump to different sections on the same page using IDs. The sections have tabindex="-1" to allow keyboard focus after jumping.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Linking to Sections Example</title>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.5;
padding: 1rem;
}
nav {
background-color: #f0f0f0;
padding: 1rem;
margin-bottom: 2rem;
border-radius: 0.5rem;
}
nav a {
margin-right: 1.5rem;
color: #0066cc;
text-decoration: none;
font-weight: 600;
}
nav a:hover, nav a:focus {
text-decoration: underline;
outline: none;
}
section {
margin-bottom: 3rem;
}
h2 {
color: #333;
}
</style>
</head>
<body>
<nav aria-label="Main navigation">
<a href="#intro">Introduction</a>
<a href="#features">Features</a>
<a href="#contact">Contact</a>
</nav>
<section id="intro" tabindex="-1">
<h2>Introduction</h2>
<p>Welcome to our website. Use the links above to jump to different sections.</p>
</section>
<section id="features" tabindex="-1">
<h2>Features</h2>
<ul>
<li>Easy navigation</li>
<li>Fast access to content</li>
<li>Improved user experience</li>
</ul>
</section>
<section id="contact" tabindex="-1">
<h2>Contact</h2>
<p>You can reach us at <a href="mailto:info@example.com">info@example.com</a>.</p>
</section>
</body>
</html>