Forum Moderators: not2easy
If you've got to have it, it can probably be done, but <sup> is valid HTML4 and will be valid HTML5. The class is a big hack to the code, especially if you have very many links. I would be inclined to live with it.
HTML 4
[w3.org...]
HTML 5
[dev.w3.org...]
Even hacking the font-size: and vertical-align: in a class won't drop the raised baseline in IE. I don't know what else to use.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
.superscript {
font-size: 60%; vertical-align: top;
}
</style>
</head>
<body>
<div>
<a href="#">R<sup>5</sup></a>
</div>
<br /><br /><br />
<div>
<a href="#">R<span class="superscript">5</span></a>
</div>
<!--##########
So, i have<a href="#">R<span class="superscript">5</span></a>
and the underline for my <a> is broken, which i don't want. How do i get the anchor underline to be one unbroken line under both the R and the 5?
-->
</body>
</html>
I would use as conditional comment if I used it. It will remove the raised text-decoration: in IE7,8 if you find it unsightly - especially if there are characters after the <sup>, because IE will restore the baseline after closing <sup>.
a sup {
text-decoration: none;
}
or
sup {
text-decoration: none;
}
CSS:
.super a {
text-decoration: none; border-bottom: 1px solid #00e;
}
.super a:visited {
border-bottom-color: #551a8b;
}
HTML:
<div class="super">
<a href="http://www.example.com">R<sup>5</sup></a>
</div>
<edit> Specifying hex color for 'blue'. </edit>
[edited by: D_Blackwell at 4:11 am (utc) on Oct. 19, 2009]