Home  >  Article  >  Web Front-end  >  In-depth understanding of src and href in HTML

In-depth understanding of src and href in HTML

高洛峰
高洛峰Original
2017-03-28 11:20:132080browse

1. src and href

src, the abbreviation of source, means "source", and source code means "source code".

href, the abbreviation of Hypertext Reference, means hypertext reference.

2. Classification

1. src

① Insert the picture into the web page , specify the location of the picture.

② Frame page

③ JS file introduction

2. href

① Internal link: name

② outer link: & lt; a href = "url" & gt; name & lt;/a & gt;

## ③ Anchor notes: & lt; a href = "#object-name" & gt;/a & gt;/a & gt ;name

④ Link description text: Link description

# ⑤ Special effect link (script support): JavaScript script:

& lt; a href = "javascript: Alert (‘ Night, rest early! ')">Click me!

⑥ External CSS reference:

⑦ External XSL Modify XML document:

⑧XML data island:

3. Difference

          src is the positioning source position, which can be a relative or absolute position. Such as: image location, script file

href is used to locate external links, but there are exceptions: CSS and Or add it, please point it out in the comments below and I will correct it in time, thank you!

The above is the detailed content of In-depth understanding of src and href in HTML. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn