Write code often confuse these two properties, in the end is the href or src,href identifies a hypertext reference, used in link and a and other elements,href is a reference and page association, is to establish a connection between the current element and the reference resource,src means referencing the resource, representing the replacement of the current element, and on the img,script,iframe , SRC is an integral part of the page content.
SRC is the abbreviation for source, which is the location of the external resource, which is moved to the location of the current label in the document, and the resource it points to is downloaded and applied to the current document when the src resource is requested, such as the JS script, IMG images and frame elements.
<script src= "Js.js" ></script> when the browser resolves to this sentence, it pauses the download and processing of other resources until the resource is loaded, compiled, executed, and so is the image and frame elements. Similar to the resource that the element points to is nested within the current tag, which is why the JS rice is then the bottom instead of the head.
<link href= "Common.css" rel= "stylesheet"/> when the browser resolves to this sentence will recognize the document as a CSS file, will download and will not stop the processing of the current document, This is also why it is recommended to use the link method to load CSS instead of using @import.
Add: The difference between link and @import
Both are external ways of referencing CSS, but there are some differences:
The difference between 1:link is XHTML tags, in addition to loading CSS, you can also define RSS and other transactions, @import belong to the CSS category, can only load CSS.
The difference between 2:link referencing a CSS, loading at the same time when the page loads, @import need to load the page after full loading.
The difference between 3:link is XHTML label, no compatibility problem, @import is proposed in CSS2.1, the lower version of the browser is not supported.
The difference 4:ink supports using JavaScript to control the DOM to change styles, while @import does not support it.
The difference between src and href in html