Transferred from CSDN, the original sticker address http://blog.csdn.net/zlwzlwzlw/article/details/7768313/
Recently encountered a small problem in the project, tangled half a day.
What is the difference between using a slash/and a backslash \ in a path. After reviewing some information, we know.
UNIX uses a diagonal bar/As a path delimiter, and Web apps are most recently used on UNIX systems, so all network addresses currently use a slash/delimiter.
Windows is marked with the use of a diagonal bar/As a parameter of the DOS command prompt, and in order not to be confused, use the backslash \ as the path delimiter. So the file browser on the Windows system is now using the backslash \ as the path delimiter. With the development of the DOS system has been eliminated, the command prompt is also used very rarely, the oblique bar and the backslash in most cases can be interchanged, no impact.
Knowing this background, you can summarize the conclusion:
(1) The browser address bar URL using the diagonal bar/;
(2) The Windows file Browser uses a backslash \;
(3) The path that appears in the HTML URL () attribute, the specified path is a network path, so you must use a diagonal bar/;
<div style= "Background-image:url (/image/control/title.jpg); Background-repeat:repeat-x; padding:10px 10px 10px 10px "></div>//if the URL is followed by a backslash, no background is displayed
(4) The path that appears in the normal string, if it represents a Windows file path, uses the slash/and backslash \ is the same, or if the network file path is represented, you must use a diagonal bar/;
//local file path,/and \ is equivalent to //Network file path, be sure to use the diagonal bar/
The difference between a diagonal bar/and a backslash is basically these, and the relative and absolute paths are discussed below.
./src/this writes the SRC folder in the current directory;
.. /src/this to indicate that the current directory in the previous level of the directory in the SRC folder;
/src/this to indicate that the project root directory (can only disk root directory, can also refer to the project root directory, depending on the actual situation)
A little cold knowledge, the difference between a slash/and a backslash in a path