简体   繁体   English

无法使用 sup 标签使商标符号加粗

[英]Unable to make the trademark symbol bold using sup tags

I am actually trying to make the trademark symbol bold and tried the below options.我实际上是在尝试将商标符号加粗并尝试了以下选项。 However, it is not working not sure what else i can try to make the trademark symbol bold?但是,它不起作用,不确定我还能尝试使商标符号加粗吗? Any suggestions please.请有任何建议。

Option 1  : <p>This text contains <strong><sup>&#174;</sup></strong> text.</p>
Option 2  : <p>This text contains <b><sup>&#174;</sup></b> text.</p>

Your code is making it bold, but the ® is so small (especially in a superscript) that it is extremely difficult to see the difference.您的代码使它变得粗体,但 ® 太小(尤其是在上标中),很难看出区别。 The snippet below shows your code (first line) which indeed makes the symbol bold, and the same code without the <strong> tags (second line) to show the visual difference.下面的代码片段显示了确实使符号加粗的代码(第一行),以及没有<strong>标签的相同代码(第二行)以显示视觉差异。 Both have been enlarged.两者都被放大了。

Note that some fonts already show the ® symbol as a superscript.请注意,某些 fonts 已经将 ® 符号显示为上标。 (eg Consolas and Calibri) Helvetica (the main font on StackOverflow) and Times New Roman (the default font in most browsers, which also applies to Stack code snippets) do not show the ® symbol as raised. (例如 Consolas 和 Calibri) Helvetica(StackOverflow 上的主要字体)和 Times New Roman(大多数浏览器中的默认字体,也适用于 Stack 代码片段)不会将 ® 符号显示为凸起。 The point is this: make sure the font you use doesn't already make it a superscript.重点是:确保您使用的字体尚未使其成为上标。

If you wish to make the symbol more bold than the bold style of your font, you would need to use a different font just for the symbol or use an image.如果您希望符号比字体的粗体样式更粗体,则需要为符号使用不同的字体或使用图像。

 <p style="font-size:200%">This text contains <strong><sup>&reg;</sup></strong> text.</p> <p style="font-size:200%">This text contains <sup>&reg;</sup> text.</p>

The way you are doing it should work.你这样做的方式应该有效。 But in my case it was hardly noticeable (but definitely a small change).但就我而言,它几乎不引人注意(但绝对是一个小变化)。

You could try using css to make it bold, if the style is overridden.如果样式被覆盖,您可以尝试使用 css 使其粗体。

-- HTML
<p>This text contains <span class="bold-text"><sup>&#174;</sup></span> text.</p>

-- CSS
.bold-text {
    font-weight: bold !important;
}

Or you could use an image instead.或者,您可以改用图像。
<p>This text contains <img src="restricted.png" alt="restricted image"> text.</p>

Just some suggestions.只是一些建议。

As an alternative solution, you could use FontAwesome , which provides free and lightweight icons.作为替代解决方案,您可以使用FontAwesome ,它提供免费且轻量级的图标。 See the documentation on how to use it.请参阅有关如何使用它的文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM