search
HomeWeb Front-endHTML TutorialWhat new attributes are added to the a tag in HTML5

The new attributes of the a tag in HTML5 include charset, shape, coords, downloadNew, etc. to modify the link style

The a tag in HTML5 has added many new attributes. Many new functions and styles have been added to hyperlinks. Today I will introduce in detail the attribute values ​​​​in the new a tag in HTML5

HTML5 The main function of the tag is to be used for hyperlinks. You can link to other pages or other local files. The most important attribute of the element is the href attribute, which specifies the target of the link. If there is no href attribute, you cannot use attributes such as target and type.

【Recommended course: HTML5 course

What new attributes are added to the a tag in HTML5

##Example:

<a href="http://www.php.cn/">PHP中文网</a>

The difference between HTML and HTML5 is that the tag in html can be either a hyperlink or an anchor point, but in HTML5 the tag is a hyperlink. Link

New attribute of tag in HTML5

charset: not supported by html5, refers to the character encoding of the url

coords: not supported by html5 , refers to the coordinates of the link.

downloadNew: Specify the download link

hreflang: The base language of the target URL, only used when the href attribute exists.

mediaNew: The media type of the target URL, only used when the href attribute exists and the default value is all.

name: HTML5 does not support the name of the anchor.

rel: Not supported by html5, refers to the relationship between the target URL and the current document.

shape: Not supported by html5, refers to the shape of the link.

taget: refers to where to open the target URL, only used when the href attribute exists.

type New: Specifies the MIME type of the target URL, only used when the href attribute exists.

Case Sharing

Create a link shape for a star image with a circle shape


<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<img  src="/static/imghwm/default1.png"  data-src="images/12.jpg"  class="lazy"   usemap="#xingxing" alt="What new attributes are added to the a tag in HTML5" >
<map name="xingxing" id="xingxing">
  <area href="https://baike.baidu.com/item/%E6%98%9F%E6%98%9F/5683398?fr=aladdin" shape="circle" coords="96,195,10" target="_blank"></area>
 </map>
</object>
</body>
</html>

Before clicking


What new attributes are added to the a tag in HTML5

After clicking

What new attributes are added to the a tag in HTML5

When you click on this coordinate circle, the a link will jump to the link specified by the a tag.

Summary: The above is the entire content of this article, I hope it will be helpful to everyone's learning.



The above is the detailed content of What new attributes are added to the a tag in HTML5. 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
index.html是什么文件?index.html是什么文件?Feb 19, 2024 pm 01:36 PM

index.html代表网页的首页文件,是网站的默认页面。当用户访问一个网站时,通常会首先加载index.html页面。HTML(HypertextMarkupLanguage)是一种用于创建网页的标记语言,index.html也是一种HTML文件。它包含网页的结构和内容,以及用于格式化和布局的标签和元素。下面是一个示例的index.html代码:<

css怎么去掉a标签自带颜色css怎么去掉a标签自带颜色Apr 25, 2024 pm 05:42 PM

要去除 a 标签自带颜色,可使用以下方法:使用 CSS 的 color 属性指定文本颜色。使用 CSS 的 link-color 属性指定链接颜色。使用 CSS 的 text-decoration 属性去除下划线和默认文本颜色。使用 CSS 的 hover 颜色属性更改鼠标悬停时的文本颜色。使用 CSS 的 visited 颜色属性更改已访问过的 a 标签的文本颜色。

怎么用a标签跳转到另一个页面怎么用a标签跳转到另一个页面Sep 11, 2023 pm 04:01 PM

a标签来创建超链接,然后通过a标签,可以将一个页面链接到另一个页面。详细介绍:要实现页面跳转,需要将目标页面的URL填写到href属性中,URL可以是相对路径,也可以是绝对路径,相对路径是相对于当前页面的路径,而绝对路径是完整的URL地址。

3秒跳转页面实现方法:PHP编程指南3秒跳转页面实现方法:PHP编程指南Mar 25, 2024 am 10:42 AM

标题:3秒跳转页面实现方法:PHP编程指南在网页开发中,页面跳转是常见的操作,一般情况下我们使用HTML中的meta标签或者JavaScript的方法进行页面跳转。不过,在某些特定的情况下,我们需要在服务器端进行页面跳转。本文将介绍如何使用PHP编程实现一个在3秒内自动跳转到指定页面的功能,同时会给出具体的代码示例。PHP实现页面跳转的基本原理PHP是一种在

跳转到指定页面的PHP代码实现方法跳转到指定页面的PHP代码实现方法Mar 07, 2024 pm 02:18 PM

在编写网站或应用程序时,经常会遇到需要跳转到指定页面的需求。在PHP中,我们可以通过几种方法来实现页面跳转。下面我将为您演示三种常用的跳转方法,包括使用header()函数、使用JavaScript代码和使用meta标签。使用header()函数header()函数是PHP中用来发送原始的HTTP头部信息的函数,在实现页面跳转时可以结合使用该函数。下面是一个

PHP网页中文乱码怎么办?一篇完整解决方案PHP网页中文乱码怎么办?一篇完整解决方案Mar 26, 2024 pm 03:27 PM

PHP网页中文乱码问题是在网页显示中出现中文字符显示为乱码的情况,这种情况通常是由于编码不一致或者未设置字符集导致的。解决PHP网页中文乱码问题需要从多个方面入手,以下是一些常见的解决方案以及具体的代码示例。设置PHP文件编码:首先确保PHP文件本身的编码是UTF-8,可以在编辑器中设置保存时使用UTF-8编码,或者在PHP文件头部添加如下代码设置编码:&l

a标签属性有哪些a标签属性有哪些Nov 24, 2023 am 09:51 AM

a标签属性有:1、href;2、target;3、rel;4、download;5、hreflang;6、type。详细介绍:1、href,定义链接的目标URL,这是“<a>“标签最常用的属性,它可以链接到网页的任何部分,如页面顶部、特定段落等;2、target,定义链接在哪里打开;3、rel,定义链接的关系,这个属性允许指定当前文档与链接文档之间的关系等等。

jQuery小技巧:快速修改页面所有a标签的文本jQuery小技巧:快速修改页面所有a标签的文本Feb 28, 2024 pm 09:06 PM

标题:jQuery小技巧:快速修改页面所有a标签的文本在网页开发中,我们经常需要对页面中的元素进行修改和操作。在使用jQuery时,有时候需要一次性修改页面中所有a标签的文本内容,这样可以节省时间和精力。下面将介绍如何使用jQuery快速修改页面所有a标签的文本,同时给出具体的代码示例。首先,我们需要引入jQuery库文件,确保在页面中引入了以下代码:<

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!