There is a difference between src and href, and they can be confused. src is used to replace the current element, and href is used to establish a connection between the current document and the referenced resource. 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 tag 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 scripts, img images, frame elements, etc. <script src ="js.js"></script> When the browser parses this element, it will pause the downloading and processing of other resources until the resource is loaded, compiled, and executed. The same applies to elements such as images and frames, which is similar to embedding the pointed resource into the current tag. This is also why you should put js scripts at the bottom instead of at the top. href is the abbreviation of Hypertext Reference, which points to the location of a network resource 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, and will download the resources in parallel without stopping the processing of the current document. This is why it is recommended to use the link method to load CSS instead of the @import method. |
<<: Mysql example of splitting into multiple rows and columns by specific symbols
>>: Looping methods and various traversal methods in js
We need to first combine the air quality data wit...
Overview Nginx load balancing provides upstream s...
Table of contents 1. Install Docker on CentOS 7.9...
statement : This article teaches you how to imple...
Table of contents 1. Introduction 1. What is an i...
This article example shares the specific code of ...
Table of contents Preface Component Introduction ...
Phenomenon: Run an image, for example, ubuntu14.0...
Preface MySQL is a relational database with stron...
1. First go to the official website https://www.p...
Table of contents background Compile glibc 2.14 M...
Table of contents Preface How to encapsulate a To...
animation Define an animation: /*Set a keyframe t...
Preface: I recently started to study the construc...
Before the arrow was shot, the bow whispered to t...