OnlineCBT Logo OnlineCBT
HTML Tutorial
HTML · LESSON 47

HTML File Paths

By Ratan Updated: 16 Oct 2026

Master linking files across subdirectories, root folders, and parent directories.

Level: Beginner to Advanced
Duration: ~60 Mins Deep-Dive

1. Mastering HTML File Paths

Broken images and non-loading CSS stylesheets are overwhelmingly caused by file path confusion. An HTML file path describes where a file is located in a website folder structure.

2. Path Patterns Reference

Syntax Meaning Example
style.css Located in the exact same folder as the HTML file.
assets/css/style.css Located in a subfolder relative to current location.
../images/logo.png Jump up one folder level, then enter images.
/assets/js/app.js Root-relative: Starts from website root directory.

3. Crucial Rules for Web File Paths

  • Always use forward slashes (/), never Windows backslashes (\).
  • Web file systems (Linux hosting servers) are case-sensitive: logo.PNG is not the same as logo.png.
  • Avoid spaces in file names; use hyphens (e.g., student-report-card.pdf).

📝 Live Lesson Practice

HTML/CSS JavaScript Python C++ C PHP
⌨️ Practice Inputs (लाइव इनपुट भरें) (खाली होने पर RED, भरने पर GREEN underline)
💻 Code Editor (Monaco VS Code Engine)
👀 Live Preview
Address Contact

+91 7877547686

E-mail

onlinecbtportal@gmail.com

Helpline Number

+91 7877547686


Click To Download
Get it on Google Play

ऐप डाउनलोड करने
के लिए Google Play पर
उपलब्ध है

WhatsApp Chat