我有一个带有样式下划线的元素。
在链接中有 TM 元素。
是否可以在所有单词的底部添加下划线,因为现在行中有一个中断,并且 sup 元素中的下划线更高。
感谢帮助
最佳答案
<u>This is some text for Brand Name™ to test the error.</u>
行得通。我无法重现您的错误。
编辑
好吧,我的错 - 我回答时没有使用 <sup>
元素。如果您只是使用商标 (™) 标记,最好只使用 HTML 表达式,即 ™
- 直接在您的文本中使用它。
关于您的问题,您确实有两个选择。
CSS
sup {
padding-bottom: 4px;
border-bottom: 1px solid black;
}
* 您可能需要调整 padding-bottom
值取决于您的行高。
HTML
<u>This is a Brand</u><sup>for a company</sup><u> and then some more text</u>
或者,Lollero 的版本(修改为在线工作)...
CSS
div.underline { display: inline; padding-bottom: 1px; border-bottom: 1px solid #222; }
HTML
<div class="underline">what'<sup>s UP</sup></div>
关于html - <sup> 在带下划线的元素中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7468614/