Home > Web Front-end > HTML Tutorial > How to set link to image in html

How to set link to image in html

藏色散人
Release: 2023-01-05 16:14:29
Original
20972 people have browsed it

htmlHow to set a link to an image: first create an HTML sample file; then create an image through the img tag; finally pass "" syntax can be used to set links to images.

How to set link to image in html

The operating environment of this article: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.

Use a tag to implement

Code such as:

<a href="链接的地址"><img src="图片的URL" width="图片的宽度" height="图片的高度" border="边框"></a>
Copy after login

Definition tag defines a hyperlink, used to link from a page Go to another page.

Usage:

The most important attribute of the element is the href attribute, which indicates the target of the link.

The HTML code for the link is simple.

It looks like this:

Extended information

Picture hyperlink:

Hyperlink simply means linking by content.

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.

The so-called 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 or an email address. , a file, or even an application.

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.

Recommended learning: "html video tutorial"

The above is the detailed content of How to set link to image 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