在 html 文档中使用 title 属性:
<abbr title="people's republic of china">prc</abbr> was founded in 1949. <p title="free web tutorials">w3school.com.cn</p>
定义和用法
title 属性规定关于元素的额外信息。
这些信息通常会在鼠标移到元素上时显示一段工具提示文本(tooltip text)。
提示:title 属性常与 form 以及 a 元素一同使用,以提供关于输入格式和链接目标的信息。同时它也是 abbr 和 acronym 元素的必需属性。
支持
w3c: "w3c" 列指示 w3c 的 html/xhtml 推荐标准中是否定义了该属性。
ie firefox opera safari w3c
yes yes yes yes yes
语法
<element title="value">
属性值
值 描述
text 规定元素的工具提示文本(tooltip text)
1,html的title属性,当光标移动到该标签时,信息提示框内的内容
</body> <hr> <p title="html的标签真多啊!">属性选择器</p> </body>
设置标签样式时指定 属性css样式
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <!--页面内容关键字--> <meta name="keywords" content="页面内容关键字"> <title>css:是层叠样式表</title> <!--外部样式--> <link rel="stylesheet" type="text/css" href="css1.css"> <style type="text/css"> /*有tittle属性*/ [title] { color: darkmagenta; } /*指定tittle属性值*/ [title=t] { color: red; } </style> </head> <body> <hr> <p title="html的标签真多啊!">属性选择器</p> <hr> <p title="t">属性选择器指定属性值</p> </body> </html>
以上就是html规定关于元素的额外信息的属性title的详细内容。