How am I supposed to write superscript text?

耗尽温柔 提交于 2019-12-01 19:35:58

Just use <sup>super</sup>,

As you have seen in the reference from W3C the sup tag is just a routine for the CSS:

sup {
    vertical-align: super;
    font-size: smaller;
} 

Pros: It works across all platforms and this is what it's intended for. Also provides semantic meaning to screen readers and other 'bots.

Cons: Some people just love to do it themselves in CSS.

Edit: And full credit to j08691 - for this very succinct comment:

SO filters what code you can use, and it has no bearing on what you should use in your own projects

The <sup> tag is fine for ordinary paragraph text, but what about text inside a "title" field; for example, ...title="Tombeau de Napoléon 1er"...?

I cannot get the 'er' ('st' in English!) in a superscript position. The <sup> tag has no effect. :-(

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!