Skip to content

Commit a9c5a24

Browse files
committed
doc: add controls,coords attribute document.
1 parent b417dca commit a9c5a24

File tree

5 files changed

+116
-8
lines changed

5 files changed

+116
-8
lines changed

docs/attribute/content.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ HTML content 属性
2121

2222
```html
2323
<head>
24-
<meta name="description" content="Free Web tutorials">
25-
<meta name="keywords" content="HTML,CSS,XML,JavaScript">
24+
<meta name="description" content="Free Web tutorials">
25+
<meta name="keywords" content="HTML,CSS,XML,JavaScript">
2626
</head>
2727
```
2828

docs/attribute/controls.md

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,72 @@
1-
controls.md
1+
HTML controls 属性
22
===
33

4-
欢迎您编辑 <a target="__blank" href="https://github.com/jaywcjlove/html-tutorial/blob/main/docs/attribute/controls.md">docs/attribute/controls.md</a> 文件,共建 HTML Tutorial 文档。
4+
## 定义和用法
5+
6+
`controls` 属性是一个布尔属性。
7+
8+
如果存在,它指定应显示音频/视频控件。
9+
10+
控制应包括:
11+
12+
* 播放 Play
13+
* 暂停 Pause
14+
* Seeking
15+
* 音量 Volume
16+
* 全屏切换(仅适用于 video 视频)
17+
* 字幕/字幕 (仅适用于 video 视频,如果可用)
18+
* 轨道 (仅适用于 video 视频,如果可用)
19+
20+
## 适用于
21+
22+
`controls` 属性可用于以下元素:
23+
24+
| 元素 Element | 属性 Attribute |
25+
| ----- | ----- |
26+
| [\<audio>](../tags/audio.md) | [controls](../tags/audio_controls.md) |
27+
| [\<video>](../tags/video.md) | [controls](../tags/video_controls.md) |
28+
29+
## 示例
30+
31+
### Audio 示例
32+
33+
带有浏览器默认控件的 [\<audio>](../tags/audio.md) 元素:
34+
35+
```html idoc:preview:iframe
36+
<audio controls>
37+
<source src="horse.ogg" type="audio/ogg">
38+
<source src="horse.mp3" type="audio/mpeg">
39+
您的浏览器不支持音频元素。
40+
</audio>
41+
```
42+
43+
### Video 示例
44+
45+
带有浏览器默认控件的 [\<video>](../tags/video.md) 元素:
46+
47+
```html idoc:preview:iframe
48+
<video width="320" controls>
49+
<source
50+
type="video/mp4"
51+
src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4">
52+
<source
53+
type="video/webm"
54+
src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm">
55+
您的浏览器不支持 video 标签。
56+
</video>
57+
```
58+
59+
## 浏览器支持
60+
61+
`controls` 属性对每个元素都有以下浏览器支持:
62+
63+
| 元素 Element | ![chrome][1] | ![edge][2] | ![firefox][3] | ![safari][4] | ![opera][5] |
64+
| ------- | --- | --- | --- | --- | --- |
65+
| [audio](../tags/audio.md) | 4.0 | 9.0 | 3.5 | 4.0 | 10.5 |
66+
| [video](../tags/video.md) | 4.0 | 9.0 | 3.5 | 4.0 | 10.5 |
67+
68+
[1]: ../assets/chrome.svg
69+
[2]: ../assets/edge.svg
70+
[3]: ../assets/firefox.svg
71+
[4]: ../assets/safari.svg
72+
[5]: ../assets/opera.svg

docs/attribute/coords.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,44 @@
1-
coords.md
1+
HTML coords 属性
22
===
33

4-
欢迎您编辑 <a target="__blank" href="https://github.com/jaywcjlove/html-tutorial/blob/main/docs/attribute/coords.md">docs/attribute/coords.md</a> 文件,共建 HTML Tutorial 文档。
4+
## 定义和用法
5+
6+
`coords` 属性指定图像地图中某个区域的坐标。
7+
8+
`coords` 属性与 [`shape`](./shape.md) 属性一起使用来指定区域的大小、形状和位置。
9+
10+
**提示:** 区域左上角的坐标为 `0,0`
11+
12+
## 适用于
13+
14+
The `coords` attribute can be used on the following element:
15+
16+
| 元素 Element | 属性 Attribute |
17+
| ----- | ----- |
18+
| [\<area>](../tags/area.md) | [coords](att_area_coords.asp) |
19+
20+
## 示例
21+
22+
带有可点击区域的图像地图:
23+
24+
```html idoc:preview:iframe
25+
<img src="../assets/workplace.jpg" alt="Workplace" usemap="#workmap" width="400" height="379">
26+
<map name="workmap">
27+
  <area shape="rect" coords="34,44,270,350" alt="Computer" href="../tags/a.html">
28+
  <area shape="rect" coords="290,172,333,250" alt="Phone" href="../tags/abbr.html">
29+
  <area shape="circle" coords="337,300,44" alt="Cup of coffee" href="../tags/address.html">
30+
</map>
31+
```
32+
<!--rehype:style=height: 330px;-->
33+
34+
## 浏览器支持
35+
36+
| 属性 Attribute | ![chrome][1] | ![edge][2] | ![firefox][3] | ![safari][4] | ![opera][5] |
37+
| ------- | --- | --- | --- | --- | --- |
38+
| coords | Yes | Yes | Yes | Yes | Yes |
39+
40+
[1]: ../assets/chrome.svg
41+
[2]: ../assets/edge.svg
42+
[3]: ../assets/firefox.svg
43+
[4]: ../assets/safari.svg
44+
[5]: ../assets/opera.svg

docs/tags/applet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ HTML \<applet> 标签
3535
<video width="320" controls>
3636
<source type="video/mp4" src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4">
3737
<source type="video/webm" src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm">
38-
Your browser does not support the video tag.
38+
您的浏览器不支持 video 标签。
3939
</video>
4040
```
4141

docs/tags/video.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ HTML \<video> Tag
1313
<source
1414
type="video/webm"
1515
src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm">
16-
Your browser does not support the video tag.
16+
您的浏览器不支持 video 标签。
1717
</video>
1818
```
1919

0 commit comments

Comments
 (0)