How to Avoid Paragraph Gaps when Using Superscript and Subscript

Frequently, when I see a webpage with superscript or subscript text, I see associated gaps in the paragraph. This is caused because the default way browsers render super and subscript text is to add enough vertical space in the paragraph to show them. The result is ugly, but as you can see in the following screenshot, you can easily fix the problem with just a few lines of CSS.

HTML Superscript and Subscript Handling

In the first paragraph, you can see the layout gap problem, and in the second paragraph, you can see the paragraph as it should be displayed, by using the following CSS rules.

sup {
	vertical-align: baseline;
	position: relative;
	bottom: .33em;
}
sub {
	vertical-align: baseline;
	position: relative;
	bottom: -.33em;
}

The browser shifts the super and subscript text by using the vertical-align CSS property, which leaves gaps in the paragraph. By resetting this property to the defaul value of baseline, we get rid of the gaps. Then we restore the appearance of the text by using position: relative; and shifting the bottom up or down by .33em. Since this uses ems, you can use these lines in your reset stylesheet, no matter what font treatment you use on your site. Now go forth, and may paragraph gaps never plague you again!

Note: This was originally posted on my work blog, and I’m re-posting it here for archival purposes.

Talk Like Warren Ellis

A few weeks ago, I called my friend Miles and asked him to help me out with the programming on a project I dreamed up. Here’s how I put it to him:

Scott: “I want you to help me with a project that will either get no attention at all, or a ton. [pause to build anticipation] Talk Like Warren Ellis dot-com.”

Miles: “Oh, awesome.”

In case you’re not familiar, Warren Ellis is the famed author behind comics likeTransmetropolitan,Planetary and the novelCrooked Little Vein. He is famous on the internet for posting horrifying images of body modification on his blog and has one of the most popular Twitter feeds on the network.

On Twitter, he frequently signs on for the day by saying something along the lines of “Good morning, my little lovegoats of the internet!” Because he posts this kind of thing frequently, I had the idea that we could construct a random warren-ellis-ism generator by compiling list of vocabulary words and parsing his grammar.

Miles got excited because he had tried something similar in college with a James Bond movie title generator, and had some ideas for how to improve the coding.

After a lot of scrolling through Warren’s twitter archives and debating the finer points of Warren Ellis Grammar, Miles delivered the final code to me, and now you can enjoy the results at TalkLikeWarrenEllis.com.

The day I posted it, it only got traffic from people I know, but we made it this morning. Right before I went to lunch, Warren signed into Twitter and said “Back from holiday. Who requires punishment?

I replied “Welcome back! While you were gone, I made this:” and added a link to the site. Then I went to lunch, hoping that he might see it in the flood of replies he certainly gets.

When I came back from lunch, the site was getting a bunch of traffic. Turns out he saw it:

Warren Ellis Noticed Us!

Bugzilla’s Reset Password Page Sucks

Bugzilla's Reset Password Screen

Frequently, my coworkers will forget their Bugzilla passwords. They come to me, because I manage it, and I always send them to the reset password page. Inevitably, they come back a few minutes later and tell me that it didn’t work, and I just reset their passwords by hand. Well, I finally figured out the problem. Take a look at this screenshot and see if you can spot the problem. Remember that they’ve gotten to this page by clicking on a link that says “Reset Your Password.”

In case it’s not obvious, here’s a screenshot with the reset password form highlighted:

Bugzilla's Reset Password Screen Highlighted

Yes, that’s right, when you click on “Reset Your Password,” you’re taken to a page where the first and clearest call to action is a login form! Hidden beneath it is the actual form, but no one ever sees it. Seriously, Bugzilla, I love you guys, but hire a UI designer, please.

Note: This was originally posted on my work blog, and I’m re-posting it here for archival purposes.

Why Aren’t You Using Fireworks to Compress Images?

I’m sure you’ve all heard the Fireworks vs. Photoshop debate. When I started at Pop Art, I was a Photoshop user. It was the application that we were taught in my graphic design program, and when I found out that the creative team used Fireworks, it took quite awhile for them to convince me that Fireworks is better for the kind of work a web agency does. Over time, I became a convert, but recently I had an experience that cemented Firework’s status for me.

Continue reading

Who’s Afraid of HTML Email?

Anyone who tells you creating HTML email is easy has either never done it, or is lying. Inexperienced designers tend to think, “Oh, no problem, it’s all tables and font tags!” Grizzled veterans, however, know all too well the difficulties of getting anything but the most simple design to render well in a variety of clients.

Email design today is like web design in the early 90′s, complete with nested tables, spacer gifs, and FONT tags galore. Standards support is virtually non-existent, and even simple things like background images and table spacing are handled poorly by some clients.

Continue reading