5.html 5 path Representation
The role of paths in html is to introduce external resources, such as css files, js files, and media files.
The paths are divided into relative paths and absolute paths. The relative path is another page path relative to the link page. The absolute path is the complete Path Directly starting from file: // disk operator. (Note: The drive letter is mainly for windows ).
1. absolute path
<A href = "file: // D:/HTML5/code/index2.html"> index2 </a>
Explanation: First, it starts with file: //, then a disk character, and then a directory hierarchy to find the corresponding file. The most critical problem with this method is that when the entire directory is transferred to another drive letter or another computer, once the directory structure changes, the link immediately becomes invalid.
2. Relative Path
<A href = "index2.html"> index2 </a>
Explanation: The relative path must be in one disk or directory. If the file is in the same directory, the directly connected property value is the linked file name. suffix. If there are multiple sub-directory layers under the same main directory, you need to use the directory structure syntax.
3. Directory syntax
The same Directory: index2.html or./index2.html;
In the subdirectory: xxx/index2.html;
In the sun tzu Directory: xxx/index2.html;
In the parent directory: ../index2.html;
In the grandpa's directory: ../index2.html;
Finally, it should be noted that, no matter whether you find it or not, the path separators in windows and linux systems are different. windows is \, while linux is /. However, no matter what platform is finally running, the path representation must use the linux habit, that is /.