Keyboard Skip Link
A skip-to-content link becomes visible through keyboard navigation, letting users bypass the header.
A skip-to-content link becomes visible through keyboard navigation, letting users bypass the header.
Live Demo
Hover over the element or use Tab to focus.
Source Code
Copy the HTML, CSS or JavaScript you need for your project.
<div class="tbx-1062"><a class="tbx-1062__skip" href="#tbx-1062-main">Skip to content <span aria-hidden="true">↘</span></a>
<div class="tbx-1062__nav"><span>LOGO</span><small>MENU ABOUT</small></div>
<main id="tbx-1062-main" tabindex="-1"><b>Main content</b><p>Press Tab to reach the skip link, then Enter to jump to content.</p></main>
</div>
.tbx-1062{width:min(304px,100%);font:11px/1.5 system-ui,sans-serif;color:#304d60;border-radius:10px;position:relative;padding-top:44px}
.tbx-1062__skip{position:absolute;top:6px;left:11px;display:flex;gap:12px;align-items:center;background:#214e66;color:#fff;text-decoration:none;padding:9px 13px;border-radius:6px;opacity:.2;transform:translateY(-7px);transition:opacity .2s,transform .2s;font-weight:750;font-size:10px}
.tbx-1062__skip span{font-size:15px}.tbx-1062__skip:is(:hover,:focus-visible){opacity:1;transform:translateY(0)}.tbx-1062__skip:focus-visible{outline:3px solid #eda95c;outline-offset:2px}
.tbx-1062__nav{background:#edf1f4;border:1px solid #d8e1e8;border-radius:7px 7px 0 0;display:flex;align-items:center;justify-content:space-between;padding:12px 14px}.tbx-1062__nav>span{font-size:12px;letter-spacing:.08em;font-weight:900;color:#456877}.tbx-1062__nav small{font-size:8px;letter-spacing:.04em}
.tbx-1062 main{background:white;border:1px solid #d8e1e8;border-top:0;padding:15px 14px;border-radius:0 0 7px 7px;scroll-margin-top:10px}.tbx-1062 main b{font-size:11px}.tbx-1062 main p{font-size:10px;line-height:1.65;margin:7px 0 0;color:#748795}.tbx-1062 main:focus{outline:2px dashed #4c9199;outline-offset:1px}
@media(prefers-reduced-motion:reduce){.tbx-1062__skip{transition:none}}
How to Use
Insert the HTML and add the CSS to your stylesheet. Adjust colors and sizes and avoid class conflicts.
Use Case
Useful for accessibility sections and navigation menus.
Technical Notes
Keep controls usable on touch devices. Test keyboard focus and reduced-motion preferences.
Mobile: Ensure the interactive content remains accessible without hover on touch devices.
Browser: Uses modern CSS. Check behavior in the browsers you support.
Reduced Motion: Check that prefers-reduced-motion is respected.