Home > Article > Web Front-end > About the text in the middle of src=""_html/css_WEB-ITnose
What is the difference between entering "filename" and entering "/filename"?
How to enter to select files from the root directory?
1. If there is a virtual web container:/filename, select the file from the root directory.
The web container refers to placing your files under apache, tomcat, and iss.
If not, the "/file name" will not be recognized by html.
2. File name/file.html
This means that the file name and the current file are in the same directory, so access is relative. Does not depend on whether it is in a virtual web container.
Then the solution: If it is in a virtual web container, just "/file name".
If it is not in the container, it only has ../../ file name, which can be obtained by relative path.
1. If there is a virtual web container:/filename, select the file from the root directory.
The web container refers to placing your files under apache, tomcat, and iss.
If not, the "/file name" will not be recognized by html.
2. File name/file.html
This means that the file name and the current file are in the same directory, so access is relative. Does not depend on whether it is in a virtual web container.
Then the solution: If it is in a virtual web container, just "/file name".
If it is not in the container, it only has ../../ file name, which can be obtained by relative path.
What is the difference between filename and /filename?
The difference is that the former starts from the current directory (relative path), and the latter starts from the root directory (absolute path)
Those who do web development must face two sets of paths:
1. File system
2. web system