Codebitch : Click to return to MacEdition homepage
 

It’s your own damn default

July 1, 2002

Feedback Farm

Have something to say about this article? Let us know below and your post might be the Post of the Month! Please read our Official Rules and Sponsor List.

Forums

Want to dig even deeper? Post to the new MacEdition Forums (beta)!

As Web content producers begin adopting standards-oriented authoring practices, they hit a learning curve. They become frustrated with the different presentation of CSS elements by the different browsers. Sometimes this is justified; even the browsers that support standards best have bugs and support gaps. Other times, it’s not the fault of the browser, but of the Web author.

People will make mistakes with any new technology, so some of the strange glitches Web authors might see are simple coding errors. The simple answer to this is to validate, validate, validate! In time, one eventually remembers that it’s color not font-color, although I confess I can never remember whether it’s clear:both or clear:all. (It’s both, but the HTML attribute clear uses the property keyword all. Wouldn’t it have been nice if the W3C had been consistent about this?)

Even stylesheets with perfectly correct syntax will sometimes give unexpected results, and cause people to grumble about quirky Mozilla or stupid Opera or whatever. One thing I’ve often noticed is that people often complain about browsers’ varying presentation of properties they haven’t defined. That is, they’re not complaining about different browsers’ interpretation of CSS. They’re complaining that different browsers have different default stylesheets. Although the W3C has a suggested default stylesheet, there’s no obligation for browsers to follow it. So if one browser uses margin on the BODY element, and another uses padding, that’s not a bug, or a even necessarily a frustration. I don’t know how else to say this but, “Get over it, people!” You can’t expect to control something you haven’t defined. We all got used to different default background colors back in the old days of Netscape and IE 2.0, so we can get used to this.

Similarly, we have to get used to other good authoring practices, like making sure both color and background color are set, or specifying a generic font-family as well as that list of Microsoft TrueType Web fonts that everyone uses. (Georgia is the new Verdana. Doesn’t it warm your heart?) Specifying things that need to be specified is part of that. You don’t need to specify font-size:1em on BODY, but you do need to specify margins on paragraphs and padding on body and html. Read the spec and check what properties have default values. Specify what you seek to control, and don’t specify properties to have their default values unless you know that it gets around some browser bug. In particular, specifying line-height can cause problems in (surprise!) Netscape 4. If you don’t have strong views about line spacing, why not let the various browser defaults rule instead of being a control freak? But if you are a control freak, specify it to your liking instead of moaning about browser “bugs” that are really just different defaults.

Turn down the volume

I couldn’t write a column about defaults in browsers without talking about font sizes. The px-unit versus ems debate has been hashed over a thousand times on every Web design list and newsgroup I can think of in the past couple of years, sometimes several times. There are pros and cons to both sides (although everyone agrees that only fools, masochists and the designers of some well-known but clueless commercial sites use points to size text for onscreen presentation).

I confess that I lean towards the relative-sizing side, in the interests of accessibility. This isn’t a no-brainer decision. Defunct browsers like IE3 have problems with ems and font-size keywords are treated inconsistently across browsers. Although some workarounds have been proposed, getting things just right is not easy.

Thus there’s a reasonable argument for sighing and settling for px unit font sizes. The only way you can use ems or percentages and not get into a bunch of strife is to do as the lovely Mr. Zeldman pointed out recently: “Ems work well as long as you never spec your text below the user’s default size.” By this, Zeldman means that you shouldn’t specify the font size for basic elements like P, BODY, and LI differently from 1em. Headings and other elements can be larger, and any “fine print” you need can be smaller, but not too much smaller. Personally I wouldn’t want to go below about 0.8em even for fine print.

So if I want to use relative sizing, I also have to be satisfied with the presentation of text in the browser’s default size. Since many browsers specify a 16px default that many people find ungainly, a lot of Web designers try to alter it to something more to their liking. Designers did the same thing back in the pre-CSS world of font tags: lots and lots of <font size="1"> tags. So then, when people encounter normal-sized text, they find it huge by comparison – and sometimes they complain. Fortunately I have a thick enough skin not to be hurt by such clueless ravings. But it’s annoying.

If you think that MacEdition’s text is too big, it’s your fault, not mine. Our stylesheet doesn’t set the base font size, you do. If you think it looks like a big print book, that’s your setting, not our doing. It’s your fault! (Was that loud enough?) So don’t complain to me, select “Preferences” from the Edit menu, or “Options” from the Tools menu, or however it works in your browser of choice. Text Zoom is an option for users of some browsers, but it’s no substitute for setting your preferences properly in the first place.

So that’s the unique challenge of designing for screen presentation on the Web. I don’t know if you have a big screen or a little one, a Psion or a PC. I don’t know if you have your browser window at full size or not. I don’t know if you have lasik-enhanced 20/20 vision like me, or a serious visual impairment. I don’t know if you’re an interior decorator or you’re color blind. I can set the formatting to be flexible but attractive, but it’s all going to fall apart if browsers don’t follow standards. It’s also going to fall apart if I only set some properties and take the rest on faith.

As a Web designer, I have no right to complain about stylistic elements that I haven’t defined. And as a Web reader, you have no right to complain if you don’t set your own damn defaults.

— CodeBitch (codebitch@macedition.com) is the grumpy cow who does the HTML production for MacEdition. Read other articles by CodeBitch

E-mail this story to a friend

Talkback on this story!

Cannot connect to the database.
Please contact the administrator.