What Is The HTML File Paths

A record HTML File Paths way portrays the area of a document in a site’s envelope structure.

File Path Examples

HTML File
<img src=”picture.jpg”>The “picture.jpg” file is located in the same folder as the current page
<img src=”images/picture.jpg”>The “picture.jpg” file is located in the images folder in the current folder
<img src=”/images/picture.jpg”>The “picture.jpg” file is located in the images folder at the root of the current web
<img src=”../picture.jpg”>The “picture.jpg” file is located in the folder one level up from the current folder

HTML File Paths

A record way portrays the area of a document in a site’s envelope structure.

Record ways are utilized when connecting to outside documents, as:

  • Site pages
  • Pictures
  • Templates
  • JavaScripts

Absolute File Paths

An absolute file path is the full URL to a file:

Example

<img src=”https://www.Examples.com/images/picture.jpg” alt=”Mountain”>

The <img> tag is explained in the chapter: HTML Images.

Relative File Paths

A relative record way focuses to a document comparative with the current page.

In the accompanying model, the record way focuses to a document in the pictures envelope situated at the foundation of the current web:

Example

<img src=”/images/picture.jpg” alt=”Mountain”>

In the accompanying model, the document way focuses to a record in the pictures organizer situated in the current envelope:

Example

<img src=”images/picture.jpg” alt=”Mountain”>

In the accompanying model, the document way focuses to a record in the pictures organizer situated in the envelope one level up from the current organizer:

Example

<img src=”../images/picture.jpg” alt=”Mountain”>