The difference between slash/and backslash in the URL summary _ other synthesis

Source: Internet
Author: User

Recently encountered a small problem in the project, tangled for half a day.
The difference between using a slash/and a backslash in a path is exactly what. After consulting some information, we know.
UNIX uses a diagonal bar/as a path separator, and Web applications are most recently used on UNIX systems, so all network addresses currently use a diagonal bar/separator.
Windows uses a backslash \ as a path separator because it is used as a parameter marker for a DOS command prompt and is not confusing. So the file browser on the Windows system is currently using the backslash \ as the path separator. As the development, the DOS system has been eliminated, the command prompt also uses very few, the oblique pole and the backslash in most cases may interchange, has no influence.

After you know this background, you can summarize the conclusion:
(1) Browser address bar site using a diagonal bar/;
(2) Windows file browser using a backslash \;
(3) The path that appears in the HTML URL () property, the path specified is the network path, and must be in a diagonal bar/;

Copy Code code as follows:

<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 the path of the Windows file is represented, using the diagonal bar/and the backslash \ is the same, and if the network file path is represented, you must use a diagonal bar/;
Copy Code code as follows:


Local file path,/and \ is equivalent


Network file path, be sure to use a diagonal bar/

The difference between a diagonal rod/and a backslash is basically this, and then the relative path and absolute path are discussed below.

Copy Code code as follows:

/src/writes the SRC folder in the current directory;
.. /src/writes this to the current directory in the upper-level directory of SRC folders;
/src/This means that the project root directory (can only disk root directory, can also refer to the project root directory, depending on the actual situation)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.