The HTML file path specifies the location of the file within the website folder. A file path is very similar to a web browser's file address. Using the HTML file path, any external file or resource can be linked to the HTML file.
1. HTML file path
A file path describes the location of a file within a website's folder structure. The file path will be used when linking external files:
(1)Web page
(2) Image
(3) Style sheet
(4)JavaScript
2. Path classification
Netizens often find that pictures on their web pages cannot be displayed. In fact, most of the reasons are because your address is written incorrectly. The pictures or videos on the web page have their own corresponding storage locations. Web pages find them simply by their path.
If the page needs to find the picture, it can be achieved through the path. The path is divided into relative path (commonly used) and absolute path.
(1) Relative path
Relative paths point to files relative to the current page. In the following example, the file path points to a file located in the images folder in the root directory of the current website;
The process of finding the target file starting from the current file is divided into same-level directories, upper-level directories, and lower-level directories.
a.Similar directory
The current file and the target file are in the same directory
b.Superior directory
The target file is in the upper-level directory
c. Subordinate directory
The target file is in the lower-level directory
2. Absolute path
An absolute file path refers to a complete URL pointing to an Internet file; an absolute path in a directory can directly reach the target location and is divided into a path starting from the drive letter and a complete network address.
Example:
<imgsrc=https://www.dotcpp.com/oj/image/photo.pngalt=demo>