用于反转<abbr>的元素

Mr *_*ter 8 html semantic-markup

是否有一个HTML元素,我可以用它来表示"这是一个缩写词的含义",如果我想要在文本中显示完整的含义而不是在<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>
Run Code Online (Sandbox Code Playgroud)

我现在滥用的地方可以使用哪些元素mark

PS你可能会考虑回答根本不使用标记,但是我想让这个名字以斜体显示,所以我确实需要一些东西!

Bol*_*ock 6

不幸的是,HTML没有专用元素来表示缩写的扩展形式.

HTML5规范中的abbr这个示例似乎非常接近您的用例,除了缩写在段落中的扩展之后出现,而不是在包含缩写dd之后的元素中dt.该示例演示如何使用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>
Run Code Online (Sandbox Code Playgroud)

根据描述dfn,(强调我的):

dfn元素表示一个项的定义实例.作为元素的最近祖先的段落,描述列表组或部分dfn还必须包含dfn元素给出的术语的定义.

你应该能够同样标记你的内容:

<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>
Run Code Online (Sandbox Code Playgroud)

但是,我不确定a是否适合dfn出现在a 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>
Run Code Online (Sandbox Code Playgroud)

(而且我可能会将其dfn作为孩子的dt父母abbr而加入)