带有下划线的元素中的<sup>

gru*_*ber 4 html css

我有一个带有样式下划线的元素.

在链接中有TM元素.

是否有可能在所有单词的底部设置下划线,因为现在有一个中断并且sup元素中的下划线更高.

谢谢你的帮助

小智 5

<u>This is some text for Brand Name&trade; to test the error.</u>

这样可行.我无法重现你的错误.

编辑 好吧,我的坏 - 我没有使用<sup>元素回答.如果您只是使用商标(™)标记,最好只使用HTML表达式,&trade;即直接在文本中使用.

关于你的问题,你真的有两个选择.

CSS

sup {
    padding-bottom: 4px;
    border-bottom: 1px solid black;
}
Run Code Online (Sandbox Code Playgroud)

*您可能需要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>