Learning Resources
Linking to a Specific Part of a Page
What is an Anchor Link?
An anchor link allows users to jump to a specific section of a webpage. This is useful for long pages where you want to provide quick navigation.
Step-by-Step Guide
1. Assign an ID to the Target Section
To link to a specific part of a page, first, you need to assign an id
to the section you want to jump to.
2. Create the Anchor Link
Now, create a link (<a>
tag) that points to the id
of the section.
Clicking on this link will take the user directly to the Contact Us section.
3. Link to a Specific Section from Another Page
If you want to link to a section on another page, use the page URL followed by #id
.
This will take users to the "team" section inside about.html
.
4. Smooth Scrolling Effect (Optional)
To make the transition smoother, you can add CSS:
This ensures a smooth scroll effect when jumping to the section.
Practice Example