The difference between URL, href, and src

Source: Internet
Author: User

Detailed Address: 1190000002877022, the following is only a personal summary.

URL (Uniform Resource Locator) Uniform Resource Locator .

A Uniform Resource Locator is a concise representation of the location and access methods of resources that can be obtained from the Internet, and is the address of standard resources on the Internet. Each file on the Internet has a unique URL that contains information that indicates the location of the file and how the browser should handle it.

structure:

Mode (or protocol) + server name (IP address), path, and file name, for example: 1190000002877022. Generic Uniform Resource Identifier with the authorization section.

  Category: absolute URLs and relative URLs (the location of the folder that contains the URL itself as a reference point)

Definition and difference of href and src

1.href (hypertext Reference) The location of the network resource, the browser recognizes that the current resource is a stylesheet, and page resolution is not paused (because the browser requires style rules to draw or render the page, the rendering process may be paused). This is not the same as putting the contents of the CSS file in the <style> tag, so it is recommended to use the link tag instead of @import to import the stylesheet into the HTML document.

The 2,SRC (Source) property simply embeds the current resource into the location defined by the current document element, and the page loading and processing is paused before the browser downloads, compiles, and executes the file. This process is similar to putting the JS file in the <script> tab. This is also recommended to put the JS file to load the bottom of the reason. Of course, the IMG tab is similar to this. The browser pauses loading until the image is extracted and loaded.

  

The difference between URL, href, and src

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.