Typography on the web is anything but simple, and for many, it is a troubling mystery. Today, we're going to review six ways that web designers and developers can improve the typography of the sites they create.
Introduction
Typography is the art of designing letters, words, paragraphs, and how they interact with each other. Many designers and developers often equate typography with choosing a font or typeface, while others simply forget that 95% of web design is typography and tend to forget about it. Clearly, if typography is really 95% of web design, it should be at the forefront of the mind of every designer and developer. Here are Six Ways To Improve Your Web Typography.
1. Understand the Basics of Typography
The Basics of Typography are important for all designers, whether or not they are designing for the web.
Typographic Definitions
Below are some basic typographic definitions that every designer/developer should understand when dealing with typography. This list is by no means comprehensive. See the Recommended Reading List at the end of this article for more comprehensive glossaries.
- Ascender: Any portion of a lowercase letter that rises above the meanline.
- Baseline: The line upon which the text rests.
- Cap Height: The top of a given line not including leading.
- Descender: Any portion of a lowercase letter that drops below the baseline.
- Kerning: The width of space between two given characters used to achieve the optimal appearance. Generally, kerning is automatically done by the given application, but it is necessary to understand that Photoshop (or other image editing software) does not neccessarily provide the same kerning as does a web browser.
- Leading: The height of spacing between any two lines in a section. The optimal amount of leading is generally half the height of the font's size. For example, if using a font size of 12px, there should be 6px of leading.
- Letter Spacing: The default width of space between any given set of characters. This is also sometimes called "Tracking."
- Ligatures: Special glyphs that combine two separate characters into one glyph. Ligatures are often automatically created in design programs like Photoshop or InDesign but are generally not rendered as individual glyphs in web browsers. If the use of ligatures is desired on the web, using HTML or Unicode character entities to create them manually.
- Line Height: The height of a line including any leading added. Line Height is the most effective method of controlling vertical rhythm. For example, if using a font size of 12px for standard body text, there should be roughly 6px of leading, which translates into a line-height of 18px.
- Measure: The width of a given line or column of text (generally in characters). The optimal amount of measure for reading in my experience is generally 60 characters, but this varies from font to font based on letter spacing and word spacing.
- Rendering: The process of interpreting type by a browser or other application. Every browser, application, and operating system renders type differently.
- Weight: The boldness or lightness of a given font. Online with rendered type, it is best to stick to two font weights: normal and bold. With image-based typography, using other weights such as Semibold, Light, and Black, is much easier.
- Word Spacing: The width of a space between two given words.
- X-Height: The height of the text between the baseline and the meanline. This is equivalent to the height of a typical lowercase letter (originally, the "x" glyph).
Typographic Scale

To create an effective typographic scale, the best method I have found is to use the unit of size measurement "em," as it sets the size relative to the base of a given document. In the example below, the base font-size is 12 pixels, which would set the standard font-size for paragraphs at 15 pixels.
body {
font-size: 12px;
}
h1 {
font-size: 5.0em;
}
h2 {
font-size: 4.0em;
}
h3 {
font-size: 3.0em;
}
h4 {
font-size: 2.0em;
}
blockquote {
font-size: 1.5em;
}
p {
font-size: 1.25em;
}
input {
font-size: 1.0em;
}
small {
font-size: 0.75em;
}
Vertical Rhythm
The vertical rhythm of line spacing that provides the optimal spacing for the eye to follow. To create this rhythm it is best to follow a baseline grid. From my experience, online vertical rhythm is best set at or near 1.5em. NETTUTS+, for example, uses a vertical rhythm of 1.6em, which equates to roughly to a 17.6px line-height (based on a 11px font-size).

Below is a standard vertical rhythm that I use on many of my websites built on the 960 grid system. To achieve vertical rhythm appropriately, every paragraph should have a margin or padding below equivalent to the standard baseline grid line-height.
body {
font-size: 12px;
line-height: 15px;
}
p {
margin-bottom: 15px;
}
2. Design in the Browser
As most designers and developers know, websites render differently in different browsers. This is especially true with rendering fonts. Below is a comparison of how five popular browsers render the same text differently:
When building a typographic layout or a site that is content-rich (like a magazine or blog site), being able to see the differences between the typography in each of the different browsers and operating systems is a major boon. Designing in the browser is nothing new (even back in 1997 when I created my first website, I designed it entirely in the browser). While not every site is a candidate for designing in a browser, the ones most concerned with typography are perfect for designing in a browser.
Andy Clarke, popular designer/author, recently spoke at An Event Apart Boston with a presentation called Walls Come Tumbling Down in which he advocated designing in the browser for many reasons. The image above, taken from his presentation, shows the use of a standardized grid for both columns and vertical rhythm.
The best way to design in a browser is to use a grid like this. In the source package, I have included two different columnar grids, each with three variants of vertical rhythm. The CSS below shows the easiest method of deploying one of these testing grids by replacing the background image or images in the body of the HTML page using a class specific to the grid that you choose. Simply add the specified class to the body tag or content container DIV tag, and you're ready to design in your browser.
.grid960base15 {
width: 960px;
line-height: 15px;
background: url(images/grid960base15.png) repeat-y;
}
.grid960base18 {
width: 960px;
line-height: 18px;
background: url(images/grid960base18.png) repeat-y;
}
.grid960base30 {
width: 960px;
line-height: 30px;
background: url(images/grid960base30.png) repeat-y;
}
.grid600base12 {
width: 600px;
line-height: 12px;
background: url(images/grid600base12.png) repeat-y;
}
.grid600base16 {
width: 600px;
line-height: 16px;
background: url(images/grid600base16.png) repeat-y;
}
.grid600base18 {
width: 600px;
line-height: 18px;
background: url(images/grid600base18.png) repeat-y;
}
It should be noted that for good vertical rhythm, it is necessary to have granular control over the line-height to reach the proper vertical rhythm. Additionally, you can use this Grid-making Bookmarklet to overlay any website with a customized grid. I find this to be useful when you cannot replace the background image with one of the grids.
3. Use a CSS Image Replacement Technique
Replacing text with images has been a standard practice in web design since the 90's. With the adoption of CSS in the major browsers, image replacement techniques began arising that do not simply consist of making an image and placing it in the place of the text. The first widely accepted of these was Fahrner Image Replacement (FIR), but as people played with CSS Image Replacement, they realized this technique was not accessible. The Phark Image Replacement technique was originally conceived as an accessible replacement for the classic FIR technique. First proposed by Mike Rundle of 9rules in 2003, Phark Image Replacement relies on the the use of the text-indent and background-image CSS properties to hide the text from the user but remain accessible for screen readers and search engines.
To use Phark Image Replacement, set the container element (in this case, the DIVs) with a defined height and width. Then set a background image. Finally, set the text-indent property to -9999px. The text-indent property essentially pushes the start of the text left 9999 pixels, but this does not increase the scrollable area, effectively causing the text to disappear.

While Phark is currently the most common CSS-only Image Replacement Technique, there are many others with different advantages and disadvantages. For example, Phark fails to show anything to the user if images are disabled but CSS is enabled, a relatively small disadvantage. Additionally, CSS Image Replacement is not really meant for large-scale typography (i.e. articles), but is best for buttons, headings, and other small quantities of text. To learn more about other CSS-based Image Replacement Techniques, CSS-Tricks wrote a good summary of all available CSS-based Image Replacement Techniques called Nine Techniques for CSS Image Replacement.
4. Use an "Advanced" Image Replacement Technique
Standard Image Replacement is ideal for highly decorative situations and smaller amounts of text. What do you do when you want to replace text for an entire body of an article? What about replacing headlines and keeping the text selectable? The answer here is one of the advanced image replacement techniques. For all intensive purposes, there are three different advanced image replacements available at this time (if you know of any others, please leave them in the comments): Flash-based, Javascript-based, and PHP-based.
Scalable Inman Flash Replacement (sIFR)
The first of the advanced image replacement techniques that arrived on the scene was Scalable Inman Flash Replacement (sIFR), originally designed by Shaun Inman as IFR and subsequently advanced to the sIFR designation by Mike Davidson and Mark Wubben, who currently maintain the project.
PROS:CONS:
- Most crisp font rendering due to anti-aliasing
- Retains original semantic and accessible text
- Degrades gracefully into the original text
- Text is selectable (partially)
- Unobtrusive script
- Not suited for large bodies of text
- Setup can be complicated and tricky
- Requires Flash and Javascript
- Load times can be sluggish
- Printing is problematic
If you want to learn how to implement and see examples of sIFR, NETTUTS+ has a great tutorial on how to use sIFR or visit the Official Site for sIFR2 or the Official Site for sIFR3, the most recent version.
cufón
The most recently popular advanced image replacement technique is called cufón, supposedly a portmanteau word of "custom" and "font" according to some. It "aims to become a worthy alternative to sIFR, which despite its merits still remains painfully tricky to set up and use" according to the cufón wiki.
PROS:CONS:
- Fastest advanced image replacement technique
- Retains original semantic text content
- Degrades gracefully into the original text
- Does not require any plugins (like Flash)
- Unobtrusive script
- Easy setup
- Text cannot be copied and pasted (Text is not selectable)
- Font Licensing is blurry regarding cufón
- Text justification and effects do not work
- :hover state has many quirks
- Requires Javascript
If you want to learn how to implement and see examples of cufón, NETTUTS+ has a great screencast and tutorial on how to use cufón or visit the Official Site of cufón.
Facelift Image Replacement (FLIR)
The Facelift Image Replacement (FLIR) technique is different than the two previously mentioned in that it uses server-side scripting with PHP and the GD Image Library. It was developed by Cory Mawhorter to provide an automatic server-side font replacement technique.
PROS:CONS:
- Retains original semantic text content
- Does not require any plugins (like Flash)
- Font Licensing issues are unlikely, if ever
- Text cannot be copied and pasted (Text is not selectable)
- Font rendering is subpar compared to other alternatives
- Requires a web server with PHP and GD
- Requires more server resources
- Can be difficult to set up
If you want to learn how to implement and see examples of FLIR, Divito Design has a good tutorial on how to use FLIR or visit the Official Site of FLIR
5. Use CSS3's @font-face Rule for Web Font Embedding
CSS3 is relatively new in the landscape of the web, and it has not yet gained widespread usage. One of the most exciting features of CSS3 is the @font-face rule. There are two big hurdles for using @font-face right now. First, not many font foundries and typefaces support @font-face embedding. Some licenses are vague and do not address web embedding, whereas some explicitly prohibit @font-face embedding. For a list of typefaces that support @font-face embedding, you can webfonts.info has a great list. The second hurdle is that not all browsers support the @font-face rule, as shown in the browser support table below.

The @font-face rule now allows font embedding in IE6, IE7, IE8, FireFox 3.5+ (PC & Mac), and Safari (PC & Mac) with support in Opera 10 and Chrome coming soon. This means that, in some form or fashion, webfonts will be available for an estimated 90%+ users.
Step One: Make the @font-face Declaration(s)
Ideally, this first @font-face declaration would be part of a CSS file served via conditional comments to only IE with the EOT version of the font. The second @font-face declaration should be a OTF or TTF font file. Also, due to browser security restrictions, the source URL for declarations should be relative (although some browsers do support absolute URLs).
@font-face {
font-family: "Anivers";
src: url("Anivers.eot");
}
@font-face {
font-family: "Anivers";
src: url("Anivers.otf");
}
Step Two: Use the Font
Yep. That's all there is to it.
body {
font-family: Anivers, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
Once declarations are made, the font-family that has been declared can be used like any other font that would be available on a user's system. This is an exciting new territory for web designers and developers that is going to be important to follow throughout the coming months.
Upcoming @font-face delivery projects like Typekit and Typotheque are looking to provide significant help in terms of negotiating web embedding licenses with the big font foundries. Additionally, with all the questions about renting fonts for web embedding, it may prove difficult to get some (or all) of the fonts that you are going to use in a web design for use in your image editing software. There's two solutions to this: 1) design in the browser as recommended above, or 2) use similar typefaces to design the static page designs.
6. Find Inspiration and Never Stop Learning
Typography on the web is in its infancy when compared to typography in print, broadcast, and film. Watch other forms of media for inventive typography usage. The next time you are at the movie theater, check out all of the movie posters and pay close attention to the typography used in previews and trailers. Take a look at the typography both inside and on the cover of books at your local bookstore. Examine your DVD collection or your favorite magazines for inspiration.
Online, follow leading typography experts online like For a Beautiful Web, I love Typography, TypeInspire, or webfonts.info. Below, you will find a list of recommended reading links for more information on web typography in addition to NETTUTS+ and the aforementioned.
- PSDTUTS+ Text Effects TUTS
- 101 Typography Resources from Vandalay Design Blog
- A List Apart
- Abduzeedo
- Astheria
- Font Lover
- Smashing Magazine
- The Typographic Archives
- TypeNow Type Glossary
- Typophile
- Web Designer Depot
- Web Typography Guide
Hopefully, these six tips will help you the next time you are working on typography for the web. It's an exciting time to be a typophile working on the web.
- Follow us on Twitter, or subscribe to the NETTUTS RSS Feed for more daily web development tuts and articles.
Related Posts
Check out some more great tutorials and articles that you might like
Plus Members
Source Files, Bonus Tutorials and
More for $9 a month for all TUTS+
sites in one subscription.










User Comments
( ADD YOURS )Connor Crosby August 14th
WOW interesting, thanks!
( )Connor Crosby August 14th
I never thought I would ever be first
( )Ihateyou August 14th
Who cares? I’m tired of people commenting just to say “First!” It’s old, and it’s meaningless.
Evan George August 16th
I never thought it really mattered.
Michael August 14th
Great tut!! Good idea on this one.
( )Jan August 14th
Hi, great article!
I´ve created a tool to easily manage and generat your indivdual web typography. Just give it a try; http://www.jan-quickels.de/tools-web-typography/
( )Michael Owens August 14th
Thanks, Jan; that’s a very useful typesetting tool!
( )Jan November 2nd
Thanks for your feedback! Any wishes for an upcoming version? Feel free to send me an email.
Arvind August 14th
Thnx…
( )Soner Gönül August 14th
That’s good!
Really good!
( )Drazen Mokic August 14th
This is great. My skillset is very low in typo, so this comes really good!
Thank you!
( )Jermaine Hercules August 14th
The tuts came in really handly, thanks
( )Neus Lorenzo August 14th
thanks a lot! I’m going to add this one to our delicious for my students …
( )Yoosuf August 14th
its a better one after a lil while
( )Nahid August 15th
LOL yeah
( )martin ansty August 14th
The first 3 tips here are great, but 4 & 5 seem a bit unrelated, and essentially the same. Still, anything to improve my typography skills is welcome. Will definitely be reading this over again
( )Michael Owens August 14th
I agree that tips 4 and 5 have similar effects, but the reason that tips 4 and 5 are separate is because #5 is no different to the user than using a standard web font like Arial or Verdana, whereas the advanced image replacement techniques from #4 provide a significantly different user experience, even when implemented through a font-face delivery system like Typekit / Typotheque.
( )hatkim web design August 14th
Many web designer dont know how a typographie can be benefit to a web site concept
( )Pete August 14th
Always good to fine-tune typography, if anything to pay respect to the craft and help the web come into its own typographically. Even if one site at a time.
Thanks.
( )Showpage August 14th
Thanks for the article. Really interesting.
( )Rails Guru August 14th
sIFR should not be an option.
( )Michael Owens August 14th
I’ve used sIFR to positive use before, but I have since replaced my sIFR implementations either with a CSS-based Image Replacement or cufón, myself. Many designers still prefer sIFR because it provides the best selectable anti-aliased text available (even trumping CSS3’s @font-face in this regard on PCs–on Macs, it’s about even).
( )Paul Carbo August 15th
Ignoring the fact sIFR is only meant to be used for headings, the one and only real downfall to sIFR is how tricky the set-up is. If constructed properly, printing is not an issue and load times are not an issue. It requiring JS and Flash isn’t any kind of issue in my opinion either. If someone has either one of them disabled, then they just see the default font you have set, no harm done. That’s not much of a con, but more of a side-effect.
The best thing about it is how beautifully it renders the text. I’d barely be able to match the quality using Photoshop.
I use it on my site and will admit it took me a good amount of time to perfect things, but once you get the hang of it, it becomes very simple and works wonderfully.
( )Shaun August 14th
Nice article.
Also, a tool I love to use is
( )http://www.typetester.org/
Nahid August 15th
Thanks Shaun
( )Eric B. August 14th
Thanks for the tips!
You said that text looks different in different browsers. How different would text be in the same browser, but on a different operating system?
( )Rails Guru August 14th
Very different. For example, I think FF on PC looks fugly compared to FF on Mac.
( )Evan Jones August 14th
Agreed ^_^
Dan August 15th
http://www.typechart.com
Lets you compare Mac vs PC rendering and browse type styles.
I agree Mac does a much better job!
Chris August 14th
Great article! Personally, for number 3, I prefer to:
#logo{
height: 0px;
padding-top: 20px; (Height of image)
width: 100px;
display: block;
overflow: hidden;
background: url(.jpg);
}
I find this better than -999em because when people want to ‘tab’ select items, you won’t get the anchor outline going off the page. If the image doesn’t work, at least the wording will still be in the area also.
( )Cody August 14th
Very Nice article. I need to start using em, insted of px.
( )KayroseDesign August 14th
Realy useful advice, i definatley didn’t know some of these things.
BTW i can see the recession is hitting the envato advertising sector badly, look at the sidebar compared to a couple of weeks ago
Anyway as long as envato continue there amazing network i think i can speak for everyone when i say “I’m Happy!”.
( )DanielDad August 14th
I didn’t know before it is very interesting info.
( )josh August 14th
http://www.browsershots.org if you want to see different OS
This post does not know what it wants to be. Starts off as a generic “this is what a letter consists of”, goes on to line height (which is good) then goes off on a crazy tangent to image replacement.
The typographical useful stuff in this post can be summed up with : 1.5em
( )Matt August 14th
Thanks. This is something I desperately needed to know. It’s good to have it from a source you can trust.
( )Myfacefriends August 14th
very nice and interisting… keep on shinning.
( )shalini August 29th
very very nice
( )Jasper Kennis August 15th
I really missed hyphenation in this article. Hyphenator is a javascript that very effectively supports hyphenating, something html and css still lack.
Liked the article though:)
( )Brian Temecula August 15th
There is such an easier and better way to do image replacement with CSS, and nobody every mentions it. If you indent the text or remove it with display:none, where does that leave users who disable images? They just see a blank spot. Accessibility isn’t just about screen readers. You should consider people with slow internet connections that turn images off. Nobody ever thinks to layer two divs on top of each other, one with the text behind, and one with the image above. It is easy to implement, and has no disadvantages, unless your one to nitpick about the extra div.
( )r_jake August 16th
Agreed, display:none is not a good approach, as even screen readers don’t pick this up, but I guess the reason why the Phark method is so popular is because it keeps your code semantically correct and everything still looks okay when CSS is disabled, or a different stylesheet is employed.
With the method you suggest, there is a doubling up of content (one lot of selectable html text, followed by an image of the text, if anything other than the specified stylesheet is used.
( )Nahid August 15th
Wow nice article.. I Have compiled 101 top typography tutorials list. They are worth bookmarking. Let me know hows my compilation
http://www.antsmagazine.com/101-top-photoshop-typography-tuts/
check out other articles on typography
( )Man Mohan August 15th
Really very useful article. Thanks for writing this article.
Waiting for some article from your side.
( )Filosof August 15th
>> Cufón: Text cannot be copied and pasted (Text is not selectable)
Thats not true – just try it for example in IE6
(it’s not visible, but text is selectable even in FF3)
( )Stian Jacobsen August 15th
Just to clear things up, 1 pixel is 1 pixel.. You cannot divide a pixel..
So there is nothing called 1.7 pixel.
Other then that, this was a good article.
( )saurabh shah August 16th
nice article …. thnx for sharing
( )r_jake August 16th
So let me get this straight…
IE6-8 will parse the CSS3 declaration @font-face, as long as you use an EOT font?
That seems to defy logic. Don’t suppose you could elaborate Michael?
( )Michael Owens August 16th
IE6-8 has always used the @font-face embedding rule, but it requires that the font be a specific file type called “Embedded Open Type.”
It uses the exact same code, but your font file must be created using an EOT converter like Microsoft’s WEFT tool, available at http://www.microsoft.com/typography/web/embedding/default.aspx
( )kalyan August 16th
superb!
( )Lichtathlet August 17th
negative text-indent is very very bad for Google (like everything hidden)! If you mind about SEO don’t use it!
( )Michael Owens August 17th
It is speculated by most that the effects of the Phark image replacement technique on a site’s ranking in Google only comes into play if used as a keyword stuffing technique. If you are displaying the same text in the image as you have replaced, it is not a factor. This is why most speculation on the Google algorithm states that since Google reads the document like a text-based browser (i.e. Lynx), there is no automated effect on ranking from image replacement techniques. If a site gets put under review for “black hat SEO practices” like keyword stuffing or hidden text, then any image replacement technique could be construed as “illegal” and have negative impact.
( )zamson August 17th
Great read. Thanks!
( )DemoGeek August 17th
Don’t know why but always preferred the way Safari renders fonts. It’s that extra thickness and the Helvetica’ish curvy’ness that got me to view the websites best when using Safari on Mac.
Anyone to support my case or am I just alone?
( )John Dyer August 17th
Wow great article and resources! Very funny that I just finished watching Helvetica not 10 minutes ago and this is the first article I’ve read on this site in awhile.
Thanks again!
( )KurtMac August 18th
I’ve heard Step 2 a lot about how preferable it is to use EM for font sizes and line heights instead of PX or PT. But the rest of your steps don’t follow this and denote font sizes as Pixels. So, which way is best? I’ve always used PX for sizes and am wondering what all the fuss is about and if its worth all the trouble to convert.
( )Michael Owens August 18th
On all of my production sites that do not have a tight grid (meaning any change in font size could cause layout problems), I use ems. The primary reason for using the “em” unit of measure is because of its scalability for the visually impaired.
As of early 2009 releases of WebKit, all current version browsers use full-page zoom as the default “increase size” scaling function (meaning that when you use the shortcut or file menu item to increase size, it zooms the entire page). Previously and currently on old browsers (or if you elect to use the Font-only size changing option), the only thing that would increase in size are relative size fonts (%-based or em-based fonts). Therefore, it was and still is an accessibility issue.
It’s another one of those “There is no best.” situations because every site will demand something different. If you are using a typographical layout and everything needs to be an exact size or the layout implodes upon itself, then you probably should use pixels to reach that “pixel-perfect” layout. If you’ve got an entirely (or mostly) fluid layout with your typographical elements, then you should probably use ems.
Your mileage may vary, but that’s the way I look at them. Note that I do not use the “pt” unit in any web design. It is a print design unit (equal to 1/72 of an inch) and should be used for that purpose.
( )Chris August 20th
“On all of my production sites that do not have a tight grid (meaning any change in font size could cause layout problems), I use ems. The primary reason for using the “em” unit of measure is because of its scalability for the visually impaired.”
But with modern browsers, the page gets zoomed in, the text doesn’t scale. Px is perfectly acceptable, and preferred because you then have more control over the size of fonts without having to fuss with resetting the default font size and doing unnecessary math.
Bader August 23rd
very great article , i learned alot from that
( )ConnyLo August 23rd
Thank you for this article. I have used vertical rhythm of line spacing on my site and it looks much better now.
( )Magpie August 24th
RE: 2. Design in the Browser
( )Is the Source Package missing from this Tutorial, or is it just Monday?
Alexandros September 10th
Awesome read!! Thanks!!
( )Sam Logan September 28th
Thanks for the great article! Really useful and informative.
( )Migatto October 3rd
Thank you! Great post.
( )I was reading with pleasure.
Tom - New Evolution Designs October 3rd
Interesting post!
( )Joe October 11th
Not sure if I’ve already commented on this. But I have to say this tutorial has helped me a lot!
( )