html – 数据价值,数据标题,数据原始标题,原始标题等的目的和用法是什么?

栏目: Html · 发布时间: 7年前

内容简介:代码日志版权声明:翻译自:http://stackoverflow.com/questions/17246497/what-is-the-purpose-and-usage-of-data-value-data-title-data-original-title-or

在GitHub等更现代化的网站上,我们已经看到了这些属性,并且它们总是像标题属性一样,与自定义的popover一致.

<a href="/" data-value="hovering message">Option 1</a>
<a href="/" data-title="hovering message">Option 2</a>
<a href="/" data-original-title="hovering message">Option 3</a>
<a href="/" original-title="hovering message">Option 4</a>

我读了一些关于HTML5 Doctor的数据属性的文档,我不太清楚这一点.

有没有使用它们的SEO或辅助功能?在这种具体情况下,通常用来创建popovers的插件(希望是jQuery)是什么?

简单来说,自定义数据属性的规范表明,以“data-”开头的任何属性将被视为私有数据的存储区域(私有数据在最终用户看不到的意义上 – 它不会影响布局或演示).

这允许您编写有效的HTML标记(传递HTML 5验证器),同时在页面中嵌入数据.一个简单的例子:

<li class="user" data-name="John Resig" data-city="Boston"
    data-lang="js" data-food="Bacon">
  <b>John says:</b> <span>Hello, how are you?</span>
</li>

从: Ejohn.org ‘不确定外部链接政策,只要把它放在这里,如果有人想知道’

代码日志版权声明:

翻译自:http://stackoverflow.com/questions/17246497/what-is-the-purpose-and-usage-of-data-value-data-title-data-original-title-or


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

The Intersectional Internet

The Intersectional Internet

Safiya Umoja Noble、Brendesha M. Tynes / Peter Lang Publishing / 2016

From race, sex, class, and culture, the multidisciplinary field of Internet studies needs theoretical and methodological approaches that allow us to question the organization of social relations that ......一起来看看 《The Intersectional Internet》 这本书的介绍吧!

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具