The href and src are different, and they cannot be replaced with each other. We use SRC on replaceable elements, but create a relationship between the document that the HREF uses and the external resources involved.
href (hypertext Reference) Specifies the location of the network resource to be given a link or relationship between the current document and the required anchor or resource defined by the current attribute. When we write down
<link href= "Index.css" rel= "stylesheet" >
The browser will understand that the current resource is a stylesheet, and the page resolution is not paused (because the browser requires a style rule to draw or render the page, the rendering process may be paused). This CSS file content is written in a different <style> tag, so it is recommended to use the link tag instead of @import to import the style into the HTML document.
Generally used on link and a.
The src (source) property , which simply embeds the current resource into the location of the current page document element definition, requires the address of the resource to be referenced. When the browser finds
<script src= "Index.js" >
The loading and processing of the page before the browser is downloaded, compiled, and executed during the execution of the file will be paused. In this process, JS is placed in the <script> tag similar. This is also suggested to put the JS file in the body end of the label before the reason. The browser pauses loading until the file is extracted to the loaded and extracted files.
Typically used on the img iframe script element.
The difference between src and href