Skip to content

Commit

Permalink
doc: add data,data-* attribute document.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed May 3, 2022
1 parent a9c5a24 commit 12f3293
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions docs/attribute/data.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,34 @@
data.md
HTML data 属性
===

欢迎您编辑 <a target="__blank" href="https://github.com/jaywcjlove/html-tutorial/blob/main/docs/attribute/data.md">docs/attribute/data.md</a> 文件,共建 HTML Tutorial 文档。
## 定义和用法

`data` 属性指定对象要使用的资源的 URL。

## 适用于

`data` 属性可用于以下元素:

| 元素 Element | 属性 Attribute |
| ----- | ----- |
| [\<object>](../tags/object.md) | [data](../tags/object_data.md) |

## 示例

如何使用 \<object> 元素嵌入 Flash 文件:

```html idoc:preview:iframe
<object width="400" height="400" data="helloworld.swf"></object>
```

## 浏览器支持

| 属性 Attribute | ![chrome][1] | ![edge][2] | ![firefox][3] | ![safari][4] | ![opera][5] |
| ------- | --- | --- | --- | --- | --- |
| data | Yes | Yes | Yes | Yes | Yes |

[1]: ../assets/chrome.svg
[2]: ../assets/edge.svg
[3]: ../assets/firefox.svg
[4]: ../assets/safari.svg
[5]: ../assets/opera.svg

0 comments on commit 12f3293

Please sign in to comment.