Home > Web Front-end > Front-end Q&A > What is a link in html

What is a link in html

青灯夜游
Release: 2021-12-03 13:59:16
Original
5909 people have browsed it

In HTML, a link, also called a hyperlink, refers to a connection relationship from a web page to a target. The target can be another web page or a different location on the same web page. The a tag is used to set a hyperlink in HTML, with the syntax "...".

What is a link in html

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.

A link, also known as a hyperlink, is essentially part of a web page. It is an element that allows us to connect to other web pages or sites. Only when various web pages are linked together can a website be truly formed.

Hyperlink refers to the connection relationship from a web page to a target. The target can be another web page, a different location on the same web page, or a picture, file, etc. The object used for hyperlinks in a web page can be a piece of text or an image.

When the viewer clicks on the linked text or image, the link target will be displayed on the browser and opened or run based on the type of target.

In html, use the a tag to set hyperlinks.

Syntax

<a href="所指向的目标url">链接内容</a>
Copy after login
  • The href attribute describes the target of the link. .

  • Link content can be text, images, or other HTML elements.

Example:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
	</head>

	<body>
		<a href="https://www.php.cn/">访问php中文网</a>
	</body>
</html>
Copy after login

What is a link in html

Recommended tutorial: "html video tutorial"

The above is the detailed content of What is a link in html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template