gpt4 book ai didi

html - 覆盖 样式

转载 作者:搜寻专家 更新时间:2023-10-31 22:19:35 25 4
gpt4 key购买 nike

我想忽略/覆盖 <sup>使用 CSS 设置元素样式,因此它们看起来像普通文本。我无法在我的 HTML 中展开上标元素。

换句话说

的输出
<div>Some <sup>random</sup> text.<div>

应该看起来一模一样

<div>Some random text.<div>

请问我怎样才能做到这一点?我应该尝试抵消上标的影响,还是有更聪明的方法?提前致谢!

最佳答案

您可以使 sup 标签从其父标签(div).

sup {
font-size: inherit;
vertical-align: inherit;
}
<div>Some <sup>random</sup> text.<div>

即使父级应用了更多样式,这也会起作用。

div {
font-size: 10px;
}

sup {
font-size: inherit;
vertical-align: inherit;
}
<div>Some <sup>random</sup> text.<div>

关于html - 覆盖 <sup> 样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33894134/

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