liveBook · Manning

Anchor element

As explained in WordPress Power Toolkit: Harness AI to build next-level websites

An anchor tag is the HTML element that defines a hyperlink and its linked content.

An anchor element creates clickable text that takes visitors to another page or to a specific spot on a page. It makes a recipe site easier to explore without forcing readers to scroll or hunt for related content. section 3.5.2

Write an opening <a> tag, add href="..." with the destination, place the visible link caption next, and finish with </a>. The href can use a page permalink; adding # plus a target ID sends visitors directly to that marked location. section 3.5.2

Link to a recipe page

Use a clear caption such as “See Some Mexican Specialties!” and point href to that page’s URL. For a jump within the page, give the destination an ID such as mextarget, then link to the permalink followed by #mextarget. Save the page and click the link on the site to test it. section 3.5.2

<a href="https://www.timetestedrecipes.com
/mexican-specialties/#mextarget">
Visit the second paragraph in the Mexican recipes page</a>

This listing shows an anchor whose href combines a page permalink with #mextarget, so the click opens a particular paragraph rather than the page top. section 3.5.2

How WordPress Power Toolkit: Harness AI to build next-level websites covers it

How deep it goes
Breaks down opening and closing tags, href, visible captions, permalinks, and target IDs, then tests the result.
Examples
Demonstrates links between Thai and Mexican recipe pages and a jump to a second paragraph.
What it assumes
Teaches anchor syntax from zero while assuming access to page editing and copied permalinks.
What you can do after
Build it from scratch by writing and testing links to pages or identified page locations.
How it connects
Connects hyperlinks with HTML, href attributes, permalinks, IDs, and fragment identifiers.

Also explained in

Compare how 4 books explain anchor element →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of WordPress Power Toolkit: Harness AI to build next-level websites. The section links point to the parts of the book it draws on.