Beef Brisket News Release System Summary (ii)--relative path and absolute path _ absolute path

Source: Internet
Author: User

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.


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.