HTML File Paths 📌


A file path describes the location of a file in a web site's folder structure.


HTML File paths

A file path describs the location of a file in a web site's folder structure.

File paths are used when linking to external file, like:

  1. Web pages.
  2. Images
  3. Style sheets
  4. JS(JavaScript)

There are two types of HTML File Paths.

  1. Absolute File Paths
  2. When we are going to use absolute file then we need to give full URL

  3. Relative File Paths
  4. A relative file path points to a file relative to the current page.

The below is a quick example:




Relative file path Example

                
<img src="./flower.jpg" alt="Relative Image Preview" height="500px">
            

Preview

Relative Image Preview Picture Downlode from Pixabay

"This picture will be displayed from the html.org.in website server."




Absolute file path Example

                
<img src="https://source.unsplash.com/featured/" alt="Absolute Image Preview" height="500px">
            

Preview

Absolute Image Preview

"This picture was displayed directly from the Unsplash server. It will change with a refresh..."