Jump to content

How to put link exactly at the section title

Recommended Posts

Dear all,

I am writing here because I am pretty stuck with this issue in my website

I have a quite straightforward one page layout with 5 sections and a nav bar with linksĀ to sections. I have managed to put links to the sections, but when I click on those links it does not bring me to the section title but somewhere in the section, near its bottom.

The code I am using is the following:

<a class="dropdown-item" href="#DF">

where #DF is the id of the section.

Do you know a way to link exactly at the section title?

Your help is kindly appreciated.

Thank you very much.

Link to post
Share on other sites

It depends on the layout of your page. The link should align the top of the element with the top of the window. You might have more than one element with the same ID or CSS is causing the top of the element to be further down than its visible content.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...