[英]Copyright, Registered Trademark, Trademark, and Servicemark Entity Positioning
Does anybody know why the © and ® don't superscript nicely without affecting the leading (ie line-height
) like ™ and ℠ do? 有人知道为什么©和®在不影响™和like这样的前导(即
line-height
)的情况下不能很好地上标吗?
I've tried wrapping © and ® with <sup>
and even <small>
but I can't get it to work the way I need it to. 我试过用
<sup>
甚至<small>
包装©和®,但是我无法按照我需要的方式工作。 Sometimes changing the font size helps but not always. 有时更改字体大小会有帮助,但并非总是如此。
This is for HTML emails where we use it in <h1>
, subheads, and body copy. 这是供我们在
<h1>
,副标题和正文中使用的HTML电子邮件。
When I do wrap it in <sup>
and apply CSS it just becomes difficult to control. 当我将其包装在
<sup>
并应用CSS时,它变得很难控制。 It behaves differently from one email client to another, and one device to another (this is for responsive emails). 从一个电子邮件客户端到另一个电子邮件客户端,从一个设备到另一个(针对响应电子邮件),它的行为有所不同。
Here's the fiddle: http://jsfiddle.net/cy03eov1/5/ 这是小提琴: http : //jsfiddle.net/cy03eov1/5/
And of course position:
and em
don't work well in email and margin
support is spotty. 当然还有
position:
而且em
在电子邮件中效果不佳, margin
支持也很差。
body { font-size: 26px; line-height: 1em; color: #ccc; font-family: Helvetica, sans-serif; background: lightslategray; } table { width: 80%; margin: 30px auto 0; background: #fff; padding: 5px 20px; } .copyright { font-size:70%; }
<table cellspacing="0" border="0"> <tr> <td> <p>Do you know that horrible fear when you've broken something on a client project and you have no idea how to fix it? I do… Sometimes I'll have been<span class="copyright" style="color:red;"><sup>©</sup></span> wading through templates on a site, getting it all up to scratch, then suddenly I'm faced with a page of doom—a whole<span style="color:red; font-size: 70%; vertical-align:text-top;">®</span> page of garbled semi-English that sort of resembles an error<span style="color:red;">™</span> message, but nothing I've ever seen before.</p> <p>As a freelancer, I've always been proud to have the time to dedicate to learning<span style="color:red;">℠</span>. Keeping up with the industry, and being able to level up my skills on each new project, is very important to me.</p> <p>But sometimes I struggled when I pushed myself that little bit too far. A few times I've had to request a lifeline from kind people on Twitter to pull me out of a hole. And then I feel a bit daft, having to admit my inadequacies on a social network in order to save myself from a worse situation.</p> </td> </tr> </table>
Unicode does not have superscript or subscript glyphs for these characters so you have to modify the font style separately Unicode没有这些字符的上标或下标字形,因此您必须分别修改字体样式
http://jsfiddle.net/cy03eov1/8/embedded/result/ http://jsfiddle.net/cy03eov1/8/embedded/result/
I just added 我刚刚添加
p span { }
and made the font smaller and moved it up by 8 pixels. 并缩小字体并将其上移8个像素。
I noticed you mentioned your doing this for an email. 我注意到您提到您这样做是为了发送电子邮件。 While the above mentioned solution would work fine for a webpage, it's best not to use CSS in email, especially positioning attributes like position:relative;
尽管上述解决方案对于网页来说可以正常工作,但最好不要在电子邮件中使用CSS,尤其是位置属性,例如position:relative;。
You can achieve the same affect with tables though (see demo) 您可以通过表获得相同的效果(请参阅演示)
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="20" style="font-size:18px;">Line of text followed by a </td>
<td height="20">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="10" style="font-size:9px;">©</td>
</tr>
<tr>
<td height="10"><table border="0" cellpadding="0" cellspacing="0"><tr><td><table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr></table></td></tr></table></td><!-- this is a standard table spacer alternative to email shim -->
</tr>
</table>
</td>
<td height="20" style="font-size:18px;">character.</td>
</tr>
</table>
Takes a lot more work but works across all email clients. 需要做很多工作,但可以在所有电子邮件客户端中使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.