This problem is encountered in the process of loading, clearly has written the path, but always can't load the picture, the reason, or the path of the problem, the following to distinguish between the relative path and absolute path: The key difference: In describing the directory path, the reference point used by different special symbols: " . "--Represents the current directory, relative path.
or
".."--Represents the previous level directory, relative path.
".. /.. /"-Represents the upper-level directory of the previous level directory, relative to the path.
"/"--Represents the root directory, absolute path.
"D:/abc/"--Represents the root directory, absolute path. Relative path: The directory path that is established by referencing the location of the page where the file is located. Example:
. searchbtn{
Background-image:url (".. /images/search. jpg ");
width:99px;
height:35px;
Border-style:none;
Background-color: #fff;
} <span style= "Font-family:tahoma, ' Microsoft Yahei ', Microsoft James Black;" > </span>
Advantages of relative paths:
A, easy to move content, you can move the entire directory.
B, the test method is more flexible, this machine test is more convenient. Disadvantages of relative paths:
A, the partial content page changes the position, the link is apt to fail.
B, easy to be collected by the NPC area plagiarism. Absolute path: A directory path that is based on the Web site root directory. Example:
<a href= "/ABC" > Text </a> or
Advantages of absolute paths
A, if someone plagiarized your website content, the link inside will also point to your website, some plagiarism person is lazy, do not change content at all. In fact, is not limited to plagiarism, if someone will save your web page to the local computer, the links, pictures, CSS, and JS will still be connected to your site.
B, if the page location changes, the link inside or point to the correct URL. Disadvantages of absolute paths:
A, it is not convenient to use an absolute path when coding, because a link should point to a real domain name rather than a development site.