HTML File Path
The location of a file inside a web folder structure is specified by its
file path. It functions similarly to a file's address in facilitating web
browser file access. To link to external resources like pictures, videos,
etc., use file paths.
Syntax:
<img src = "... " alt =" ">
Example for File Path
<img src ="image.png">
<img src ="downloads/image.png">
<img src = "/downloads/image.png">
<img src= "../image.png">
What are the file paths in HTML?
A file path specifies the location of a file within the folder structure of
a website.
When linking to external files, file paths such as:
- Web pages
- Images
- Style sheets
- JavaScripts
Types of File path in HTML
File paths are of two types:
- Absolute File Paths.
- Relative File Paths.
Absolute File Paths:
The complete URL (address) of the file path to access an internet file
is known as the absolute file path.
Relative File Paths:
The path of the file in relative to the current web page's location is
described by the relative file path.