🔘 1. Empty Link
- Definition: An
<a>tag with nohrefor no visible content. - Example:
<a></a>or<a href="#"></a> - Usage: Often unintentional or used as placeholders during development.
- Problem: Bad for accessibility and SEO—screen readers can’t interpret them, and users get confused.
❌ 2. Broken Link
- Definition: A link that points to a non-existent or unreachable resource.
- Example:
<a href="https://example.com/deleted-page">Click</a> - Usage: Usually accidental—caused by deleted pages, typos, or outdated URLs.
- Problem: Leads to 404 errors, hurts user experience and SEO.
🧭 3. Navigation Link
- Definition: A link used to move between sections or pages of a website.
- Example: Menu items like
<a href="/about">About Us</a> - Usage: Essential for site structure and user flow.
- Benefit: Helps users explore your site and improves crawlability for search engines.
🚫 4. Non-Navigation Link
- Definition: A link that doesn’t lead to a new page or section.
- Example:
<a href="#" onclick="toggleMenu()">Menu</a> - Usage: Often used to trigger JavaScript actions like opening modals or dropdowns.
- Note: These should be used carefully—if there's no
href, consider using a<button>instead for accessibility.
🧠 Summary Table
| Link Type | Has href |
Navigates? | Common Use Case |
|---|---|---|---|
| Empty Link | ❌ or empty | ❌ | Placeholder or coding mistake |
| Broken Link | ✅ | ❌ (fails) | Outdated or incorrect destination |
| Navigation Link | ✅ | ✅ | Menus, footers, internal links |
| Non-Navigation Link | ✅ or ❌ | ❌ | JavaScript triggers, UI toggles |
If you're building or testing a site, it's smart to audit for these regularly. Want a Selenium script to detect empty or broken links automatically? I can help you build one! 🛠️🌐
Follow on LinkedIn
Comments
Post a Comment