How to implement image hyperlink in html

王林
Release: 2020-11-13 10:50:06
Original
26528 people have browsed it

How to implement image hyperlinks in HTML: You can nest the image element in the a element to make it a link, such as [】.

How to implement image hyperlink in html

Purpose:

Set a hyperlink to the entire image file

Idea:

You can turn the image element into a link by nesting it in an a element.

(Learning video recommendation: html video tutorial)

Grammar:

<a  herf="链接地址"  target="目标窗口打开方式"><img  src="图像文件的地址"></a>
Copy after login

Example:

<a href="#"><img src="/images/relaxing-cat.jpg"></a>
Copy after login

Tips:

Use # as the href attribute of the element to convert it into a permalink.

Place an existing image element within the anchor element. When finished, hover your cursor over your image. At this point the cursor should change from a cursor pointer to a hand pointer. This image is now a link.

Related recommendations: html tutorial

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