Broken Image
Quick summary
Your `<img>` tag points to a file that doesn't exist, is in the wrong location, or failed to load — the browser shows a broken image icon.
Why this happens
Wrong file path in the
srcattributeImage file was deleted, moved, or renamed
Case-sensitive filename mismatch on a case-sensitive server (Linux)
Minimal example
<img src="/images/hero.png"><img src="/images/hero.jpg" alt="Hero image">The file is hero.jpg, not hero.png — the src path must match the actual filename. Always include alt text for accessibility.
How to diagnose
Open the image URL directly in the browser — does it load?
Check the Network tab in DevTools for a 404 status on the image
Verify the file exists at the path specified in
src
How to fix
Correct the
srcpath to match the actual file locationUse absolute URLs (
https://...) for external imagesMatch the filename exactly, including case on case-sensitive servers
How to prevent
Use build tools (Vite, Webpack) that verify asset paths at build time
Keep images in a dedicated folder with consistent naming
Related Resources
Related Lessons
- HTML
Learn HTML fundamentals
Related Practice
- HTML Heading Tag Quiz
Practice HTML tags and attributes.
- Complete the HTML Document
Practice HTML document structure.
Related Tools
- URL Parser
Parse image URLs to find path issues.