Typography Rules for Web Developers

http://flickr.com/photos/jm3/379979781/

Most web developers don't have any design background, but nevertheless they are forced from time to time to make design decisions on the projects they work on.

No matter how thorough the designer you work with is, eventually you will have a list, a form, or a dialogue box that doesn't warrant a pesky e-mail to the designer.

So what's a geek to do when presented with this situation? Luckily, 75% of typography is just a system of rules, and we can get pretty good results ignoring the other magical 25%.

Here are some rules to help you along your way.

Align it

The number one rule that web developers should follow is aligning everything on the page. For the uninitiated, this means that every element (within reason) should line up with the items near it. Focus more on vertical alignment than horizontal, this is usually easier and less error prone. Because most of your changes will be happening in the browser itself, the ruler on the Web Developer extension for Firefox can be used as a convenient straightedge to check your work while making tweaks in Firebug

alignment example

Let it Breathe

Suffocating your content is another common mistake made by non-designers. There is usually a desire to cram as much content as possible into a given area, and this can lead to a legibility nightmare.

The solution to this problem is easily solved with a healthy dose of CSS margins and padding. The rule of thumb here is add way more than you think you need and then scale back as necessary.

padding example

The Theory of Relativity

Not every element on your page is as important as the next. Now I know this may sound like common sense, but many people do not think about this when applying default style rules in their CSS.

When I am designing a layout I think of different elements as the H1's, H2's and spans they eventually will become. I know, I'm a true geek at heart, but this forces me to think of how these elements need to be sized and spaced in relation to one another.

It is important here to think about size, color, and spacing to convey the relative importance of these elements.

relativity example

Don't Make Paragraphs Too Wide

Now this one is a personal pet peeve of mine. It is very common to find a site on the web where the width of a paragraph of text is not constrained by anything but the browser window. This leads to really long lines of text. After a certain point (usually around 75 characters) long lines of text begin to become illegible.

Find your p tags in your CSS, give them a width, and move on with your life.

paragraph example

Comments

Nice tips. Here is another

Nice tips.

Here is another little tip that could be part of your "let it breath" section.

Look into the CSS "line-height" property, which is used to set the distance between lines. For example, increasing the line-height for longer lines of text will make said text easier to read.

I just tried to dm you on

I just tried to dm you on twitter to ask you a regular expression question but couldn't because you're not following me back. No blame, just wish you'd follow me back so I could dm you about reg exps.

ptw

@springnet

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options