<abbr> 的反向使用什么元素
What element to use for the reverse of <abbr>
是否有一个 HTML 元素可用于表示 "this is what an acronym means",以防我希望在文本中显示完整含义而不是在 <abbr>
的工具提示中元素.
比如我想写下"CSS"的定义,我把
<dt>CSS</dt>
<dd>Short for <mark>Cascading Style Sheets</mark>. This is the name of
the language that stylesheets are written in.</dd>
我现在滥用的地方可以使用什么元素mark
?
PS 您可能会考虑完全不使用任何标记,但我想让名字以斜体突出显示,所以我确实需要一些东西!
要么使用
<i></i> or </em></em>
或使用带有数据属性标签的跨度,例如
<dt>CSS</dt>
<dd>Short for <span data-acronym>Cascading Style Sheets</mark>. This...</dd>
或
<dt>CSS</dt>
<dd>Short for <span data-acronym="CSS">Cascading Style Sheets</mark>. This..</dd>
如果这是首字母缩略词,您也可以删除 "Short for" 并只使用
<dt>CSS</dt>
<dd>Cascading Style Sheets</dd>
然后是另一个条目
<dt>Cascading Style Sheets</dt>
<dd>The language format that web stylesheets are written in.</dd>
遗憾的是,HTML 没有表示缩写扩展形式的专用元素。
这个来自 the HTML5 spec on abbr
的示例看起来非常接近您的用例,只是缩写出现在段落的扩展之后,而不是出现在包含 dt
之后的 dd
元素中缩写。该示例演示了使用 dfn
元素来标记扩展:
<p>The <dfn id=whatwg>Web Hypertext Application Technology
Working Group</dfn> (<abbr
title="Web Hypertext Application Technology Working Group">WHATWG</abbr>)
is a loose unofficial collaboration of Web browser manufacturers and
interested parties who wish to develop new technologies designed to
allow authors to write and deploy Applications over the World Wide
Web.</p>
基于 description of dfn
,它说(强调我的):
The dfn
element represents the defining instance of a term. The paragraph, description list group, or section that is the nearest ancestor of the dfn
element must also contain the definition(s) for the term given by the dfn
element.
您应该能够类似地标记您的内容:
<dt><abbr title="Cascading Style Sheets">CSS</abbr></dt>
<dd>Short for <dfn>Cascading Style Sheets</dfn>. This is the name of
the language that stylesheets are written in.</dd>
但是,我不确定 dfn
出现在 dd
中而不是其关联的 dt
中是否合适,即使在同一个 dl
中也是如此.如果这让您感到困扰,无需求助于 span
的下一个最接近的替代方案是 i
:
<dt><abbr title="Cascading Style Sheets">CSS</abbr></dt>
<dd>Short for <i>Cascading Style Sheets</i>. This is the name of
the language that stylesheets are written in.</dd>
(我可能会将 dfn
添加为 dt
的子项和 abbr
的父项)
是否有一个 HTML 元素可用于表示 "this is what an acronym means",以防我希望在文本中显示完整含义而不是在 <abbr>
的工具提示中元素.
比如我想写下"CSS"的定义,我把
<dt>CSS</dt>
<dd>Short for <mark>Cascading Style Sheets</mark>. This is the name of
the language that stylesheets are written in.</dd>
我现在滥用的地方可以使用什么元素mark
?
PS 您可能会考虑完全不使用任何标记,但我想让名字以斜体突出显示,所以我确实需要一些东西!
要么使用
<i></i> or </em></em>
或使用带有数据属性标签的跨度,例如
<dt>CSS</dt>
<dd>Short for <span data-acronym>Cascading Style Sheets</mark>. This...</dd>
或
<dt>CSS</dt>
<dd>Short for <span data-acronym="CSS">Cascading Style Sheets</mark>. This..</dd>
如果这是首字母缩略词,您也可以删除 "Short for" 并只使用
<dt>CSS</dt>
<dd>Cascading Style Sheets</dd>
然后是另一个条目
<dt>Cascading Style Sheets</dt>
<dd>The language format that web stylesheets are written in.</dd>
遗憾的是,HTML 没有表示缩写扩展形式的专用元素。
这个来自 the HTML5 spec on abbr
的示例看起来非常接近您的用例,只是缩写出现在段落的扩展之后,而不是出现在包含 dt
之后的 dd
元素中缩写。该示例演示了使用 dfn
元素来标记扩展:
<p>The <dfn id=whatwg>Web Hypertext Application Technology
Working Group</dfn> (<abbr
title="Web Hypertext Application Technology Working Group">WHATWG</abbr>)
is a loose unofficial collaboration of Web browser manufacturers and
interested parties who wish to develop new technologies designed to
allow authors to write and deploy Applications over the World Wide
Web.</p>
基于 description of dfn
,它说(强调我的):
The
dfn
element represents the defining instance of a term. The paragraph, description list group, or section that is the nearest ancestor of thedfn
element must also contain the definition(s) for the term given by thedfn
element.
您应该能够类似地标记您的内容:
<dt><abbr title="Cascading Style Sheets">CSS</abbr></dt>
<dd>Short for <dfn>Cascading Style Sheets</dfn>. This is the name of
the language that stylesheets are written in.</dd>
但是,我不确定 dfn
出现在 dd
中而不是其关联的 dt
中是否合适,即使在同一个 dl
中也是如此.如果这让您感到困扰,无需求助于 span
的下一个最接近的替代方案是 i
:
<dt><abbr title="Cascading Style Sheets">CSS</abbr></dt>
<dd>Short for <i>Cascading Style Sheets</i>. This is the name of
the language that stylesheets are written in.</dd>
(我可能会将 dfn
添加为 dt
的子项和 abbr
的父项)