Home Web Front-end H5 Tutorial HTML5中对title属性的定义与规定

HTML5中对title属性的定义与规定

May 17, 2016 am 09:09 AM
admin h

注意,这里说的不是title标签(<title></title>),而是title属性(如 <a title=”…)

总结:

元素的title属性的值就是该元素的咨询信息,并有可能适当的以提示框的形式显示出来。
title属性是纯文本形式的。
例如:超级连接的(<a>标签)title属性可以设置成目标资源的简单描述
示例:

代码: 全选 运行

<a href="#" title="点击这里可以注册成本站会员">注册</a>

当一个元素没有设置title属性的时候,意味着该元素将受其最近一级设置有title属性的祖先元素的title属性值的影响。
当由一个元素任何祖先元素的title值都不能表达该元素的咨询信息时,你应该为它单独设置一个title值。
当一个元素没有咨询信息的时候,你可以把它设置成空字符串。
title标签可以用 (Unicode Character ‘LINE FEED (LF)’ (U+000A)的html表现形式)换行。
代码示例:

<p><a href="http://www.htmlv.cn" title="这是一个 不错的论坛">HTML5中文论坛</a></p>

以上代码当鼠标悬在连接上的时候,title的提示框将以两行的形式显示(IE7下测试通过,Firefox下测试未通过)。
对于一些特殊的元素,诸如 link, abbr, 和 input这些元素,title属性有附加的含义,超出了以上的描述。
title的属性值应该与其的内容值相符。

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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How uniapp achieves rapid conversion between mini programs and H5 How uniapp achieves rapid conversion between mini programs and H5 Oct 20, 2023 pm 02:12 PM

How uniapp achieves rapid conversion between mini programs and H5

Which version is more stable: win1121h2 or 22h2? Which version is more stable: win1121h2 or 22h2? Jan 04, 2024 am 08:53 AM

Which version is more stable: win1121h2 or 22h2?

What is the role and usage of springboot admin monitoring What is the role and usage of springboot admin monitoring May 25, 2023 pm 06:52 PM

What is the role and usage of springboot admin monitoring

How to use Flask-Admin to implement the background management interface How to use Flask-Admin to implement the background management interface Aug 03, 2023 pm 11:30 PM

How to use Flask-Admin to implement the background management interface

You need the permissions provided by admin to make changes to this file. How to solve this problem? You need the permissions provided by admin to make changes to this file. How to solve this problem? Jul 26, 2023 am 10:56 AM

You need the permissions provided by admin to make changes to this file. How to solve this problem?

Which is the better choice: win1123h2 or 22h2? Which is the better choice: win1123h2 or 22h2? Dec 28, 2023 pm 03:09 PM

Which is the better choice: win1123h2 or 22h2?

How to update Win101909 to 20H2 How to update Win101909 to 20H2 Jan 05, 2024 pm 09:53 PM

How to update Win101909 to 20H2

Solve the problem of not getting Win11 23H2 update Solve the problem of not getting Win11 23H2 update Jan 14, 2024 pm 09:24 PM

Solve the problem of not getting Win11 23H2 update

See all articles