如何在 HTML5 中实现类似 Acronym 的功能?
鉴于 acronym
在 HTML 5 中被删除,如何获得具有类似功能的标准支持?其他所有被删除的标签看起来 CSS 都可以做到这一点,但那个标签似乎被完全删除了......
Given that acronym
is removed in HTML 5, how does one get standards support with similar functionality? Every other removed tag looks like CSS can do it, but that one seems to be removed completely...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
已重新调整用途用于缩写词和首字母缩略词:
如果您想具体说明您的语义,也许添加
class="acronym"
就可以了。我认为这就是你所能做到的,尽管我应该补充一点,class
没有任何实际的语义价值。<abbr>
has been repurposed for both abbreviations as well as acronyms:If you want to be specific with your semantics, perhaps adding
class="acronym"
would do the trick. I think that's as far as you can go, although I should add thatclass
has no actual semantic value whatsoever.我以为
替换了
?
http://www.html-5.com/tags/abbr-tag/
I thought
<abbr>
replaced<acronym>
?http://www.html-5.com/tags/abbr-tag/
你能具体说明一下你想让它看起来像什么吗?
的默认样式因浏览器而异。例如,Opera 使用点下划线,而 Chrome 则不会全部设置样式。您是否想模拟特定浏览器的默认样式?
但是,如果您指的是鼠标悬停时出现的工具提示样式消息,则应该能够在
中使用与之前相同的属性:
title="your acronym'sDefinition"
。Can you clarify exactly what you're trying to make it look like? The default style for
<acronym>
differs across browsers. Opera uses a dotted underline and Chrome doesn't style it all, for example. Are you trying to emulate a particular browser's default style?However, if you mean the tooltip-style message that appears on mouse hover, you should be able to use the same attribute in
<abbr>
as before:title="your acronym's definition"
.acronym
元素被折叠到abbr
元素中,因为The
acronym
element was folded into theabbr
element, because