What is the difference between href and src in HTML?

Source: Internet
Author: User


When loading JS, the use is <script style= ' text/javascript ' src= ' js/demo.js ' ></script>
When loading CSS, the use of <link rel= "stylesheet" href= "Css/demo.css"/>

One uses SRC, and the other is href, what's the difference between the two?


The href represents a hypertext reference (hypertext Reference) and is used on elements such as link and a
SRC indicates the source address, on the IMG, script, iframe and other elements

SRC content is an essential part of the page that is introduced. The content of the href, which is associated with the page, is a reference. The difference is that the introduction and the reference.

What is the difference between href and src in HTML?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.