blob: ebb6162f642ccb579a3532262b6400a59e663923 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
---
title: <del>
slug: Web/HTML/Element/del
tags:
- Element
- HTML
- HTML edits
- Web
- del
translation_of: Web/HTML/Element/del
---
<p id="Summary">HTML的<strong><code><del></code></strong>标签表示一些被从文档中删除的文字内容。比如可以在需要显示修改记录或者源代码差异的情况使用这个标签。{{HTMLElement("ins")}}标签的作用恰恰于此相反:表示文档中添加的内容。</p>
<p>这个标签通常(但不一定要)在文字上显示删除线。</p>
<table class="properties">
<tbody>
<tr>
<th scope="row"><a href="/zh-CN/docs/Web/Guide/HTML/Content_categories">内容分类</a></th>
<td><a href="/zh-CN/docs/Web/Guide/HTML/Content_categories#短语元素(Phrasing_content)">短语元素</a> 或者 <a href="/zh-CN/docs/Web/Guide/HTML/Content_categories#流式元素(Flow_content)">流式元素</a> 。</td>
</tr>
<tr>
<th scope="row">允许的内容</th>
<td><a href="/zh-CN/docs/Web/Guide/HTML/Content_categories#透明内容模型(Transparent_content_model)">透明内容模型</a></td>
</tr>
<tr>
<th scope="row">标签省略</th>
<td>{{no_tag_omission}}</td>
</tr>
<tr>
<th scope="row">允许的父元素</th>
<td>任意<a href="/zh-CN/docs/Web/Guide/HTML/Content_categories#短语元素(Phrasing_content)">短语元素</a> </td>
</tr>
<tr>
<th scope="row">允许的 ARIA 角色</th>
<td>任意</td>
</tr>
<tr>
<th scope="row">DOM 接口</th>
<td>{{domxref("HTMLModElement")}}</td>
</tr>
</tbody>
</table>
<h2 id="属性">属性</h2>
<p><span style="line-height: 21px;">这个标签包含<a href="/zh-CN/docs/Web/HTML/Global_attributes">全局属性</a>。</span></p>
<dl>
<dt>{{htmlattrdef("cite")}}</dt>
<dd>提供一个URI,其中的资源解释作出修改的原因(比如:根据某次会议讨论)。</dd>
<dt>{{htmlattrdef("datetime")}}</dt>
<dd>这个属性说明修改的时间和日期,这里的时间和日期格式要符合<a href="https://html.spec.whatwg.org/multipage/infrastructure.html#valid-date-string-with-optional-time">规范</a>。如果设置的值不符合该规范,那么它将没有任何意义。</dd>
</dl>
<h2 id="示例">示例</h2>
<pre class="brush: html"><p><del>This text has been deleted</del>, here is the rest of the paragraph.</p>
<del ><p >This paragraph has been deleted.</p ></del ></pre>
<h3 id="结果">结果</h3>
<p><del>This text has been deleted</del>, here is the rest of the paragraph.</p>
<p><del>This paragraph has been deleted.</del></p>
<h2 id="Specifications" name="Specifications">规范</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">规范</th>
<th scope="col">状态</th>
<th scope="col">评论</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('HTML WHATWG', 'edits.html#the-del-element', '<del>')}}</td>
<td>{{Spec2('HTML WHATWG')}}</td>
<td> </td>
</tr>
<tr>
<td>{{SpecName('HTML5 W3C', 'edits.html#the-del-element', '<del>')}}</td>
<td>{{Spec2('HTML5 W3C')}}</td>
<td> </td>
</tr>
<tr>
<td>{{SpecName('HTML4.01', 'struct/text.html#h-9.4', '<del>')}}</td>
<td>{{Spec2('HTML4.01')}}</td>
<td> </td>
</tr>
</tbody>
</table>
<h2 id="浏览器兼容性">浏览器兼容性</h2>
<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p>
<p>{{Compat("html.elements.del")}}</p>
<h2 id="相关链接">相关链接</h2>
<ul>
<li>{{HTMLElement("ins")}} 标签用来表示插入文本的内容</li>
<li>{{HTMLElement("s")}} 标签用来显示删除线,代表内容被删除了</li>
</ul>
<div>{{HTMLRef}}</div>
|