DIY website updates · Page navigation

How to Link Directly to a Section of Your Website

Help a visitor reach the right detail on an existing page. A section link can point to a service explanation, an ordering question, or a contact section without creating another page.

Give the destination a unique ID, then link to the page address followed by #that-id. Check both the clicked link and a freshly opened public URL, especially on a phone.

Choose a section that answers a real question

Use a section link when the answer already belongs on a page and readers need a shortcut to it. For example, a link from a project-planning paragraph might lead directly to the information customers should send for a quote. The heading and its surrounding content should make sense when someone lands there without reading from the top.

If the destination needs a complete, separate explanation, first decide whether it deserves its own page. The static website page guide covers that broader task. Adding a fragment to a URL does not create a separate public page for your sitemap.

Give the destination a unique, durable ID

Add an id to the heading or section you want to reach. Choose a short, readable value that describes its purpose. Use a consistent lowercase-and-hyphens convention and keep the same value whenever that destination still serves the same purpose.

<h2 id="project-details">What to send for a quote</h2>
<p>Share your project goals and current website URL.</p>

This is example markup, not a promise about your business's quote requirements. Adapt the heading and text to the real process. Check that no other element on the page uses the same ID. Duplicated sections from an AI-generated edit can accidentally repeat IDs even when their visible headings are different.

On the same page, use the ID after a hash character:

<a href="#project-details">See what to send for a quote</a>

From another page, include the destination page path before the fragment. If your real destination is at /contact/, for example, the link would have this shape:

<a href="/contact/#project-details">
  See what to send for a quote
</a>

The target page must actually contain that ID. Do not paste this example into a live site without adding or verifying its destination. For a link shared outside your website, use the full production address followed by the fragment. MDN explains document-fragment links and how a URI fragment is handled by the browser.

Make the arrival point visible and understandable

Use descriptive link text instead of an unexplained icon or “click here.” A visitor should know what section they will reach. Keep a normal anchor link so the destination can be opened, copied, or used from the keyboard without requiring a custom click handler.

Check the arrival position with any fixed or sticky header. If the header covers the heading, a scoped scroll-margin-top rule can provide room:

#project-details {
  scroll-margin-top: 6rem;
}

The value above is an example. Measure your own header and check it at narrow widths and enlarged text. Avoid changing the site's overall spacing just to fix one destination. MDN documents scroll-margin-top. The accessibility checklist provides additional navigation checks.

Verify the link and a freshly opened destination

First activate the link in your preview. Confirm that it reaches the intended heading rather than another repeated section. Then copy the complete address with its fragment and open it in a fresh tab. This checks arrival from an external message rather than only scrolling within an already open page.

Try a phone-width layout and a keyboard-only path through the links. Check whether the heading is visible and whether the next action is easy to find. Test the page without relying on a menu being left open or a previous click. A hidden tab panel or collapsed section may need an additional accessible design decision; a fragment alone is not a complete solution for revealing hidden content.

After production deployment succeeds, repeat the public URL check. You can try the real section-link maintenance checklist below on this guide as a simple example of a same-page link.

Keep section links working as the page changes

Before renaming or removing an ID, search the website for links using that fragment. Also consider links in your own emails, documents, or shared instructions. Updating the visible heading does not require changing a useful, established ID.

Keep a short record of the destination page, ID, and places that use it. When moving the answer to a different page, review both the old page route and its section references. Do not assume a page redirect or a successful HTTP response proves the fragment still finds the right heading. The page redirect guide covers the separate route change.

For a complete DIY publishing workflow, explore the BUILD • PUBLISH • OWN IT guide. If you want someone to maintain navigation and content updates, review website management.

Need help with your website navigation?

Send the page URL, the section visitors should reach, and where the link will appear. We can review the scope of the update.

For the separate choice of where a link opens, see same-tab and new-tab website links.