Skip to content

Instantly share code, notes, and snippets.

Created February 7, 2023 00:19
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Skip links
<title>Skip links</title>
position: absolute;
z-index: 99;
left: -50%;
right: -50%
top: -100%;
width: 120px;
padding: 12px
background-color: black;
color: white;
transition: top .5s linear;
top: 0;
<a href="#content"
class="skip-link">Go to main content</a>
<img alt="Company logo" width="64" height="64" src="./logo.png">
<a href="#link1">Link 1</a>
<a href="#link2">Link 2</a>
<main id="content">
<h1>Main content</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla in magna at odio efficitur pretium.
Proin placerat faucibus pulvinar. Morbi molestie mauris erat, id rhoncus mauris placerat id.
Mauris vel lobortis lorem, quis dapibus felis. Morbi imperdiet at nisl nec viverra. Cras suscipit,
turpis et vulputate feugiat, dolor orci lobortis turpis, a vulputate enim enim quis est. Vestibulum ante
ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Sed scelerisque libero non laoreet
tempor. Proin fermentum erat vitae purus accumsan porta. Mauris fermentum lorem sed quam suscipit,
at accumsan eros cursus. Sed in libero sit amet dolor aliquet suscipit at at tellus. Aliquam tempus turpis
volutpat venenatis semper.</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment