Email and phone links let people contact you easily by clicking on your webpage. They open their email app or phone dialer automatically.
Email and phone links in HTML
<a href="mailto:email@example.com">Send Email</a> <a href="tel:+1234567890">Call Us</a>
Use mailto: before the email address to create an email link.
Use tel: before the phone number to create a phone link.
<a href="mailto:hello@example.com">Email Hello</a>
<a href="tel:+1234567890">Call +1 234 567 890</a>
<a href="mailto:support@example.com?subject=Help%20Request">Email Support</a>
This webpage shows two clickable links: one to send an email and one to call a phone number. The links have clear labels and keyboard focus styles for accessibility.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Contact Links Example</title> <style> body { font-family: Arial, sans-serif; padding: 2rem; background-color: #f9f9f9; color: #333; } a { color: #0066cc; text-decoration: none; font-weight: bold; } a:hover, a:focus { text-decoration: underline; outline: 2px solid #0066cc; outline-offset: 2px; } .contact { margin-top: 1rem; font-size: 1.2rem; } </style> </head> <body> <main> <h1>Contact Us</h1> <p class="contact">Email us at <a href="mailto:contact@example.com" aria-label="Send email to contact@example.com">contact@example.com</a></p> <p class="contact">Call us at <a href="tel:+1234567890" aria-label="Call phone number plus one two three four five six seven eight nine zero">+1 234 567 890</a></p> </main> </body> </html>
Make sure phone numbers use international format with plus sign for best compatibility.
Use aria-label to describe links clearly for screen readers.
Test phone links on mobile devices to confirm they open the dialer.
Email and phone links make contacting easy with one click or tap.
Use mailto: for emails and tel: for phone numbers in <a> tags.
Accessibility and clear labels improve user experience for everyone.
Practice
mailto: prefix do when used in an <a> tag?Solution
Step 1: Understand the
Themailto:prefixmailto:prefix in an<a>tag tells the browser to open the default email program when clicked.Step 2: Compare with other prefixes
Thetel:prefix is for phone calls, not emails. Other prefixes likehttp:open websites.Final Answer:
It creates a link that opens the user's email program to send an email. -> Option AQuick Check:
mailto:= email link [OK]
- Confusing mailto with tel prefix
- Thinking mailto opens websites
- Assuming mailto downloads files
Solution
Step 1: Identify the correct prefix for phone links
The correct prefix to create a phone link istel:. It tells the browser to open the phone dialer.Step 2: Check the syntax of the
The<a>taghrefattribute should betel:1234567890to work properly.Final Answer:
<a href="tel:1234567890">Call us</a> -> Option CQuick Check:
tel:prefix = phone link [OK]
- Using phone: instead of tel:
- Using callto: which is not standard
- Misspelling the prefix
<a href="mailto:info@example.com">Email us</a>
Solution
Step 1: Analyze the
Thehrefattributehrefusesmailto:with an email address, which triggers the email client.Step 2: Understand browser behavior on click
Clicking the link opens the default email program with the recipient field filled with 'info@example.com'.Final Answer:
The browser will open the default email app with 'info@example.com' in the recipient field. -> Option AQuick Check:
mailto:opens email client [OK]
- Thinking it opens a website
- Confusing mailto with tel
- Assuming no action happens
<a href="tel1234567890">Call us</a>
Solution
Step 1: Check the
Thehrefsyntaxtelprefix must be followed by a colon:to be valid.Step 2: Identify the correct fix
Adding the colon aftertelfixes the link tohref="tel:1234567890".Final Answer:
Add a colon after tel:href="tel:1234567890"-> Option BQuick Check:
Correcttel:syntax needs colon [OK]
- Omitting the colon after tel
- Using phone: instead of tel:
- Adding unnecessary slashes
Solution
Step 1: Check for accessibility and clarity
<a href="mailto:support@example.com" aria-label="Send email to support">Email Support</a><br><a href="tel:+1234567890" aria-label="Call support phone number">Call Support</a> uses clear link text andaria-labelattributes to describe the links for screen readers.Step 2: Compare with other options
<a href="mailto:support@example.com">support@example.com</a><br><a href="tel:+1234567890">1234567890</a> shows raw contact info but lacks descriptive text. <a href="mailto:support@example.com">Click here</a><br><a href="tel:+1234567890">Call now</a> uses vague text. <a href="mailto:support@example.com" title="Email">Email</a><br><a href="tel:+1234567890" title="Phone">Phone</a> usestitlewhich is less reliable for accessibility.Final Answer:
<a href="mailto:support@example.com" aria-label="Send email to support">Email Support</a><br><a href="tel:+1234567890" aria-label="Call support phone number">Call Support</a> -> Option DQuick Check:
Clear text + aria-label = best accessibility [OK]
- Using vague link text like 'Click here'
- Not adding aria-labels for screen readers
- Relying only on title attribute
Ready to prove it?
Pass the test and this pattern moves unknown
