Založte strukturu webu
21. prosinec 2017
Anchors are links which lead to a specific part of the same page. By clicking these links, the page will automatically scroll to the chosen place.
When to use anchors to create links
An anchor can be used with any link or button. It can also be used in the main navigation of the website.
Anchors are most useful on one-page presentations, where the main navigation works by using anchors to link to specific parts of the page. They can also be used within the same website, to link to a specific section of a different page.
Labeling a section for anchors
First, you have to correctly label the section to which you want to link using an anchor:
- click the pen icon in the section,
- open the Advanced tab,
- fill out the ID field with the name of the section without spaces, for example contact-form.
What will the result look like?
Setting up a link using an anchor
Setting up a link using an anchor is similar to setting up links to different pages. In the link settings tab, you can find the anchor using the autocomplete. Just write #contact-form and confirm your choice.
If you don't find the anchor in the autocomplete, set up the link using an external URL. The name of the anchor is separated from the rest of the URL with a hashtag. The anchor address looks like this: www.domain.net/contact-form.