Learn HTML

"Are you looking to learn HTML from scratch? Look no further! Our HTML course is designed for both beginners and advanced learners who want to master the fundamental concepts of HTML. Our comprehensive course covers everything from the basic concepts of HTML, including tags, attributes, and elements, to the more advanced concepts such as multimedia, responsive design, and accessibility."

HTML File Paths

HTML file paths are used to specify the location of external resources such as images, stylesheets, and JavaScript files. There are two types of file paths you can use in HTML:

 

Absolute file paths

These file paths specify the full URL or file path of a resource. They include the protocol (e.g. "http://"), the domain name, and the file path. Absolute file paths are useful when you want to link to a resource that is located on a different website or server.

Example of an absolute file path:


<img src="https://www.example.com/images/example.jpg" alt="Example Image">

Relative file paths: These file paths specify the location of a resource relative to the current HTML file. They are useful when you want to link to a resource that is located in the same folder or subfolder as the HTML file.

 

Relative file path

There are three types of relative file paths:

 

Relative to the current folder: 

These file paths specify the file path relative to the folder containing the current HTML file. They are indicated by "./" or by simply omitting any directory indicators. These paths are used to link to resources in a folder that is located in the same directory as the current document. For example, if your document is located in the root directory and you want to link to an image located in a folder called "images", you would use a relative path like this:

Example of a relative file path :


<img src="./images/example.jpg" alt="Example Image">

 

 

Relative to the move up folder: 

These paths are used to link to resources in a folder that is located outside of the current document's directory. The "../" notation moves up one directory level. For example, if your document is located in a folder called "pages" and you want to link to an image located in the "images" folder in the root directory, you would use a relative path like this:

<img src="../images/picture.jpg" alt="Picture">

 

Relative to the root folder: 

A root-relative path specifies the path to a resource relative to the root directory of the website or server. Root-relative paths always start with a forward slash (/) and include the full directory path to the resource. For example, to link to an image located in a folder called "images" in the root directory of your website, you would use a root-relative path like this:

Example of a root-relative file path:


<img src="/images/picture.jpg" alt="Picture">


Note that when using relative file paths, the file path is always relative to the location of the HTML file, not the location of the web page that is currently being displayed.