Home > Article > Web Front-end > What is the difference between href and src in html? Introduction to the difference between href and src in html
href:
href is the abbreviation of Hypertext Reference, which means hypertext reference. Used to establish a link between the current element and the document. Commonly used ones are: link, a.
The browser will recognize the document as a css document, download the document in parallel, and will not stop processing the current document.
This is also the reason why it is recommended to use link instead of @import to load css.
src:
src is the abbreviation of source. The content of src is an essential part of the page and is the introduction.
The content pointed to by src will be embedded in the document at the location of the current tag. Commonly used ones are: img, script, iframe.
When the browser parses this element, it will pause the browser's rendering until the resource is loaded.
This is also the reason why the js script is placed at the bottom instead of the head.
Related recommendations:
The difference between src and href attributes
html Empty link href="#" and href= The difference between "javascript:void(0)"
The above is the detailed content of What is the difference between href and src in html? Introduction to the difference between href and src in html. For more information, please follow other related articles on the PHP Chinese website!