Reputation: 65
I understand the simple
<a href="#sol" class="sol"></a>
<div id="sol">lorem ipsum</div>
but that navigates to the center of the div, what I would like to know is how to navigate to the top of the div not the middle.
I tried to search but everything I found was navigate to the top (of the page), I would like to keep it HTML & CSS only.
Upvotes: 0
Views: 108
Reputation: 622
The easy way would be using another a tag with a name attribute on top of your DIV:
<a href="#sol" class="sol"></a>
<a name="sol"></a>
<div>lorem ipsum</div>
Upvotes: 3