Types of Links
HTML supports various types of links beyond basic page navigation. Learn about internal anchors, email links, phone links, and more.
Page Anchor Links
Jump to sections within the same page using IDs:
Loading HTML Playground...
To create anchor links:
- Add
idattribute to target element - Link to
#id-name
Email Links
Loading HTML Playground...
Email link format:
mailto:email@example.com?subject=Subject%20Text(URL encoded)&body=Message%20body
Phone Links
Loading HTML Playground...
Phone link format:
- Use
tel:protocol - Include country code for international numbers
- Works great on mobile devices
SMS Links
Loading HTML Playground...
Fragment Links with Other Pages
Loading HTML Playground...
You can combine page URLs with fragment identifiers (#section).
Download Links
Loading HTML Playground...
The download attribute:
- Forces download instead of navigation
- Optionally specify a custom filename
Relative vs Absolute URLs
Loading HTML Playground...
Choose the right URL type:
- Absolute: External links, links shared elsewhere
- Root-relative (
/path): Internal links, works anywhere on site - Relative (
path): Links within same folder structure
Exercise: Contact Section
Create a contact section with email, phone, and anchor links:
Loading HTML Exercise...
Different link types enhance user experience by providing direct actions for common tasks!

