CSS Trick – anchor position adjustment

HTML

<ul>
  <li><a href="#link1"</li>
  <li><a href="#link2"</li>
</ul>
<a name="link1" class="anchor"></a>
<p>Some content goes here.</p>
<a name="link2" class="anchor"></a>
<p>Some content goes here.</p>

CSS

.anchor {/*anchor link*/
	display: block; 
	position: relative; 
	top: -50px; 
	visibility: hidden;
}

Leave a Reply