Src is short for search, which means search object. It is used when placing images or frames<img src=" http://img.baidu.com/img/logo-zhidao.gif ” >
Its function is to let the web page search for this object (it can be a picture or a web page, etc.) and display it, playing a reference role. Local or reference mode with link address.
Href is the abbreviation of hyperrefresh. It means to update and refresh. It is used for hyperlinks, such as:<a href="www.henenseo. com">Tutorial Self study Website</a>
There are differences between src and href, which can be confused. Src is used to replace the current element, and href is used to establish the relationship between the current document and reference resources.
Src is the abbreviation of source, which points to the location of external resources. The content pointed to will be embedded in the location of the current label in the document; When the src resource is requested, the resource it points to will be downloaded and applied to the document, such as js script, img image, frame and other elements.
<script src ="js.js"></script>
When the browser parses this element, it will pause the download and processing of other resources until the resource is loaded, compiled, and executed. This is also true for elements such as pictures and frames, similar to embedding the pointed resource into the current tag. This is why the js script is placed at the bottom rather than at the head.
Href is the abbreviation of Hypertext Reference. It points to the location of network resources and establishes a link with the current element (anchor) or the current document (link). If we add
<link href="common.css" rel="stylesheet"/>
Then the browser will recognize the document as a css file, download resources in parallel, and will not stop processing the current document. This is why it is recommended to use the link method to load css instead of the @ import method.