Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用<abbr>标签来显示带有 CSS 属性的一些修剪过的单词的完整内容text-overflow: ellipsis。
<abbr>
text-overflow: ellipsis
使用<abbr>这些词时,得到一个虚线下划线,悬停光标变为带问号的。
我确实设法使用它来改变它。但是,我不确定这是最好的方法,这种方法有什么问题吗?
abbr[title] { border-bottom: none !important; cursor: default !important; }
从 v40 开始,Firefox切换到使用 text-decoration 来提供下划线,并且 chromium 也将这样做。因此,如果您需要支持这些浏览器,您应该更新您的代码以包含该代码:
abbr[title] { border-bottom: none !important; cursor: inherit !important; text-decoration: none !important; }
它设置了一个边框和text-decoration. 删除它:
text-decoration
border: none; text-decoration: none;
示例:jsfiddle
这应该有效:
abbr[title] { text-decoration: none; }
这使用样式缩写。
abbr[title] {cursor: default !important;}
删除它abbr[title] {text-decoration: none !important;}
abbr[title] {text-decoration: none !important;}