Welcome
We've been working hard

File call in website page: what is the difference between src and href

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.

Like( zero ) Reward
Do not reprint without permission: New Start Blog » File call in website page: what is the difference between src and href


Follow the public account "New Start Software Steward"

Get the latest network resources and cracking software!
Play with all kinds of software

comment Grab the sofa

You must log in before commenting!

 

Reward the author of the article if you think it is useful

Thank you very much for your reward, we will continue to give more high-quality content, let's create a better online world together!

Scan Alipay and reward

Scan WeChat and reward