HTML File Paths

HTML Tutorial

HTML Forms

HTML Graphics

HTML Media

HTML API

HTML File Paths

HTML file paths

A file path specifies the file location in a website’s folder structure.

File paths are used for linking to external files, like:

  • Web pages
  • Images
  • Style sheets
  • JavaScripts
  • Absolute File Paths

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

Example

				
					img src="https://www.tutorialtest.com/images/picture.jpg" alt="Mountain" style="width:300px">


				
			

Relative File Paths

A relative file path refers to a file relative to the current page.

In the below example, the file path denotes a file in the images folder, that is located at the root of the current web:

Example

				
					
<img decoding="async" src="/images/picture.jpg" alt="Mountain" style="width:300px">

				
			
				
					<img decoding="async" src="../images/picture.jpg" alt="Mountain" style="width:300px">