---
id: html-file-paths
title: "HTML File Paths"
category: "Frontend"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["file path", "relative path", "absolute path", "HTML src path", "linking files", "URL path"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.89
created_at: 2026-06-23
updated_at: 2026-06-23
review_reason: ""
merge_history: []
tags: ["html", "web", "frontend", "w3schools", "file-paths", "links"]
raw_sources: ["https://www.w3schools.com/html/html_filepaths.asp"]
applied_in: []
github_commit: ""
---
# [[HTML File Paths]]
## π― ν μ€ ν΅μ°° (One-line insight)
A file path describes the location of a file within a web site's folder structure, and is used whenever an HTML page links to external files such as pages, images, style sheets, or scripts. [S1]
## π§ ν΅μ¬ κ°λ
(Core concepts)
- **File path = location in the folder structure** β it tells the browser where to find a file in a web site's folder hierarchy. [S1]
- **Where paths are used** β file paths are used when linking to external files: web pages, images, style sheets, and JavaScripts. [S1]
- **Absolute file path** β provides the complete URL (including the protocol and domain) to a file. [S1]
- **Relative file path** β points to a file relative to the current page, without a fixed base URL. [S1]
- **Best practice** β it is best practice to use relative file paths (if possible), so pages keep working across localhost and different domains. [S1]
## π§© μΆμΆλ ν¨ν΄ (Extracted patterns)
- **Same folder** β `src="picture.jpg"` references a file in the same folder as the current page. [S1]
- **Subfolder** β `src="images/picture.jpg"` references a file in an `images` folder inside the current folder. [S1]
- **Root-relative** β `src="/images/picture.jpg"` (leading slash) references a file in an `images` folder at the root of the web site. [S1]
- **Parent folder** β `src="../picture.jpg"` references a file one level up from the current folder. [S1]
## π μΈλΆ λ΄μ© (Details)
**What is a file path?**
A file path describes the location of a file in a web site's folder structure. File paths are used when linking to external files, including web pages, images, style sheets, and JavaScripts. [S1]
**File path examples**
| Path | Description |
|---|---|
| `
` | File in the same folder as the current page |
| `
` | File in the `images` folder in the current folder |
| `
` | File in the `images` folder at the root of the current web |
| `
` | File one level up from the current folder |
[S1]
**Absolute file paths**
An absolute file path is the full URL to a file: [S1]
```html
```
**Relative file paths**
A relative file path points to a file relative to the current page. [S1]
Root-relative (starts at the web root): [S1]
```html
```
Located in the `images` folder in the current folder: [S1]
```html
```
One level up from the current folder: [S1]
```html
```
**Best practice**
It is best practice to use relative file paths (if possible). When relative file paths are used, web pages will not be bound to your current base URL, and all links will work on your own computer (localhost) as well as on your current public domain and your future public domains. [S1]
## π οΈ μ μ© μ¬λ‘ (Applied in summary)
The image-linking snippets above are the canonical applied examples for referencing files from same-folder, subfolder, root, and parent-folder locations. No external project/commit applications found in the source.
## π» μ½λ ν¨ν΄ (Code patterns)
Absolute path (full URL):
```html
```
Relative paths:
```html
```
## βοΈ λΉκ΅ λ° μ ν κΈ°μ€ (Comparison & decision criteria)
- **Absolute path** β binds the reference to a specific base URL/domain; suitable for linking to external resources on other sites. [S1]
- **Relative path** β not bound to any base URL; the same markup works on localhost and across current and future domains. The source recommends relative paths when possible. [S1]
## βοΈ λͺ¨μ λ° μ
λ°μ΄νΈ (Contradictions & updates)
No contradictions found in the source.
## β
κ²μ¦ μν λ° μ λ’°λ
- **μν:** draft
- **κ²μ¦ λ¨κ³:** conceptual (μ€μ μ μ© μ¬λ‘ λ°κ²¬ μ applied/validatedλ‘ μΉκ²© κ°λ₯)
- **μΆμ² μ λ’°λ:** B (W3Schools β widely used educational reference, not a primary standards body)
- **μ λ’° μ μ:** 0.89
- **μ€λ³΅ κ²μ¬ κ²°κ³Ό:** μ κ· μμ± (New discovery)
## π μ§μ κ·Έλν (Knowledge Graph)
- **μμ/루νΈ:** [[HTML Tutorial]]
- **κ΄λ ¨ κ°λ
:** [[HTML Links]], [[HTML Images]], [[HTML Head]], [[HTML Style Guide]]
- **μ°Έμ‘° λ§₯λ½:** Referenced whenever an HTML document links to an external resource (image, stylesheet, script, or another page).
## π μΆμ² (Sources)
- [S1] W3Schools β HTML File Paths β https://www.w3schools.com/html/html_filepaths.asp
## π λ³κ²½ μ΄λ ₯ (Change history)
- 2026-06-23: Initial draft synthesized from the W3Schools "HTML File Paths" page (Astra wiki-curation, P-Reinforce v3.1 format).