Can I construct a website that works correctly in Internet Explorer? I think I can…I think I can…I think I can. Can you?
Designing websites can be frustrating for many reasons. I love making a new site, don’t get me wrong, but sometimes the frustration is maddening. Just today I was finalizing the text content for a project I am working on. Everything was coming together as planned. The client had provided timely content. The project was nearing completion. Things were looking good.
But then, as if the Gods of Web Design knew that I was almost finished, the client pointed out some sentence spacing issues on one of the pages. I immediately went to the page in question and things looked perfect to me. But as always, I switched windows and viewed the page using Internet Explorer rather than my standard Mozilla browser. Sure enough, there was a sentence spacing issue rearing its ugly head – but only in IE.
After doing some brief detective work, I narrowed the problem down to the use of the superscript tag. It appeared as though raising certain characters to superscript, such as the trademark character, was causing IE to force the sentence that contains the superscript downward, causing the space between the sentence and the one below it to become narrower. To see what I mean, just view this post and this paragraph in IE and you will see the problem. The problem is present in both 6.0 and 7.0 versions. Ugh.
Further detective work, which included searching the sitepoint forums, finally resulted in a solution to the problem. I added the following to the superscript CSS markup:
sup { vertical-align: text-top; font-size: 65%; }
The result is a workaround solution that no longer causes the sentence spacing problem in IE. It’s not perfect, because the superscript characater is not truly raised above the adjacent text, but rather is just a bit smaller and sits up against the top of the adjacent text. Not perfect, but in this case good enough to make the site display correctly in IE.
If anyone has a better solution to this problem, I would love to hear about it. In the meantime, I will just continue to hate IE. Or perhaps I should just follow the advice of Rob Mason over at Sponge Project!