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 th
Honestly I don't see the point in doing superscript/subscript in CSS only. There's no handy CSS attribute for it, just a bunch of homegrown implementations including:
.superscript { position: relative; top: -0.5em; font-size: 80%; }
or using vertical-align or I'm sure other ways. Thing is, it starts to get complicated:
The second point is worth emphasizing. Typically superscript/subscript is not actually a styling issue but is indicative of meaning.
Side note: It's worth mentioning this list of entities for common mathematical superscript and subscript expressions even though this question doesn't relate to that.
The sub/sup tags are in HTML and XHTML. I would just use those.
As for the rest of your CSS, the :after pseudo-element and content attributes are not widely supported. If you really don't want to put this manually in the HTML I think a Javascript-based solution is your next best bet. With jQuery this is as simple as:
$(function() {
$("a.external").append("+");
};