CSS中的上标? [英] Superscript in CSS only?

查看:183
本文介绍了CSS中的上标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个样式表,我用一个上标字符标记外部链接,但我有一个



我现在看起来像这样:

  a.external:after {
font-size:50%;
vertical-align:top;
content:+;
}

但不起作用。



当然,我会使用< sup> -tag,只有 content 允许HTML ...

解决方案

您可以使用 vertical-align:super (加上随附的 font-size 阅读其他答案,特别是 =http://stackoverflow.com/questions/501671/superscript-in-css-only#572967> paulmurray cletus ,以获取有用的信息。


How can I get superscript done, only in CSS?

I have a stylesheet where I mark the external links with a superscript character, but I'm having a hard time getting the character aligned correctly.

What I have currently, looks like this:

a.external:after {
  font-size: 50%;
  vertical-align: top;
  content: "+";
}

but it doesn't work.

Naturally, I'd use the <sup>-tag, only if content would allow for HTML...

解决方案

You can do superscript with vertical-align: super, (plus an accompanying font-size reduction).

However, be sure to read the other answers here, particularly those by paulmurray and cletus, for useful information.

这篇关于CSS中的上标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆