简体   繁体   中英

HTML tag properties

我的一些代码中看到使用类似的数据,ID和数据的GPS轨道属性“不寻常”的属性<a>上tag.Also唱段隐藏属性h3标签等等......所以我的问题是这些“官标签还是每个人都可以自己编写属性?

It's new* in HTML5. You can create your own data-* attributes. There is some handy usage when combining with Javascript.

Here is a pretty good run down.

https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes

The attribute mentioned in the question are allowed according to HTML5 Last Call Working Draft, which is the current W3C working group document on HTML5. Whether you call it “official” is your choice. The document itself says: “ This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.” However, many people regard the W3C HTML5 document as “standard”.

According to HTML5, authors can use data-* attributes for their own purposes. No meaning is assigned to them in the specification, and no meaning will be assigned to them in specifications. So they are a “standard” way of using custom attributes.

The aria-* attributes are not defined in HTML5, but HTML5 normatively refers to ARIA specifications for their definitions and permits using them. They have defined meanings, and their set is fixed (though it may be changed by future changes to ARIA specifications).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM