gpt4 book ai didi

html - 在带下划线的元素中

转载 作者:技术小花猫 更新时间:2023-10-29 12:03:53 26 4
gpt4 key购买 nike

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

在链接中有 TM 元素。

是否可以在所有单词的底部添加下划线,因为现在行中有一个中断,并且 sup 元素中的下划线更高。

感谢帮助

最佳答案

<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;
}

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

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com