Talking about the difference between href and src

Source: Internet
Author: User

The href represents a hypertext reference (hypertext Reference), on link, a, and so on. SRC represents the source address, which is on elements such as IMG, script, IFRAME, and so on. 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. Note that the Rel of link also can be understood as the introduction when it matches the style media.

Summary: href can be unnecessary, such as the href attribute in my link tag, if not, the content can be displayed, may show that there is no style.

SRC is introduced, is the page indispensable, for example, in the IMG, no src is nothing to show, I think this is their difference, one is introduced (indispensable), a reference

Talking about the difference between href and src

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.