The personal disquiet of

Mark Boulton

June 15th, 2007

Incremental leading

There has been a lot said recently about Ver­tical Rhythm. Richard Rut­ter began the work on 24ways last year with the piece ‘Com­pose to a Ver­tical Rhythm’. This was built upon by Wilson Minor on A List Apart recently with his art­icle on Baseline Grids. All sound typo­graphic advice. If you haven’t read both of them, I’d urge you to do so now oth­er­wise you know what I’m on about it in this post. 

At @media this year, I presen­ted ‘Five Simple Steps to Bet­ter Typo­graphy’. Step two in my present­a­tion was was Ver­tical Rhythm where I reit­er­ated some of the excel­lent points Richard made in his art­icle and also the present­a­tion we both gave in at SXSW in March. I also added some­thing of my own: Incre­mental lead­ing, or Incre­mental line-height. 

Too much lead­ing in the sidenote

Work­ing through both Richard’s and Wilson’s art­icles, they both treat the sid­e­note in the same way. They align it dir­ectly to the ver­tical rhythm unit. This is cor­rect of course. But, to my eye, the line-height in those sid­e­notes, as it’s a smal­ler type-size, is too large. 10px on 18px lead­ing is stretch­ing it. So, how do we reduce that line-height whilst still adher­ing to the ver­tical rhythm we’ve estab­lished. Once again, we look to print design for that answer.

In edit­or­ial design, there is a tech­nique used for sid­e­notes and box­outs that aligns to the baseline grid, or ver­tical rhythm. It’s called incre­mental leading. 

Incre­mental leading

Here we have a simple page of text based upon Richard’s example. There is an H1, some text, a sid­e­note and a footer. They all align to an 18px ver­tical rhythm shown in red. 

A simple document set to an 18px vertical rhythm

A simple doc­u­ment set to an 18px ver­tical rhythm

To my eyes, there is too much line-height to the sid­e­note. So, how can we reduce this line-height, but adhere to the 18px rhythm? 

Instead of align­ing every line in the sid­e­note with the ver­tical rhythm, when you use incre­mental lead­ing, you align, say, one in every four or one in every five. 

Here’s an example with incre­mental lead­ing set to align every fifth line of the sid­e­note to every fourth line in the main content. 

Sidenote set to vertical rhythm using an incremental ratio of 5:4

Sid­e­note set to ver­tical rhythm using an incre­mental ratio of 5:4

Adding in the ver­tical rhythm grid once more we can see the line alignment.

Here you can see the ratio of 5:4 incremental leading

Here you can see the ratio of 5:4 incre­mental leading

But how do I do this in CSS?

Firsty, make sure you read Richard’s art­icle and apply the rules to body of text. Once you’ve got the 18px rhythm set up and everything’s align­ing as it should, then you can look at the sidenote. 

As we’ve decided we want to align 4 rows of the main con­tent to 5 rows of the sid­e­note, we begin by find­ing the value, in pixels, of 4 rows combined. 

Four lines of the main con­tent.

18px x 4 = 72px

Then we find the value for 5 lines of the sid­e­note.

72px ÷ 5 = 14.4px

To cal­cu­late what 14.4px is in ems (in rela­tion to the body, and the type size for the sid­e­note)

14.4px ÷ 10px = 1.44em

We then add the val­ues to the CSS for the sid­e­note.

.sidenote {

text-indent:-0.7em;

width:12em;

margin-right:0;

margin-top: 0.28em;

font-size:0.8333em;

line-height:1.44em;

position:absolute;

top:0;

left:42.6em;

}

You can see this work­ing in this example.

How­ever, note the top mar­gin. I really had to fiddle around with this manu­ally to make sure the align­ment was cor­rect. I did try and work out the maths for it, but it proved to be very dif­fi­cult as really I needed to find the cap-height value of the typeface in order to provide a margin. 

Martyn, a bloke I now share an office with (who is also a Math­em­at­ics gradu­ate), provided me with this dia­gram to illus­trate my problems. 

Diagram showing relationship between baselines, vertical rhythm and how line-height is applied in CSS

Dia­gram show­ing rela­tion­ship between baselines, ver­tical rhythm and how line-height is applied in CSS

As you can see, the prob­lem is I needed to find the value of ‘x’. In order to do that, I’d need to know the value of ‘b’. The dif­fi­culty arises from try­ing to align the baselines and the only way of doing it was align­ing it by eye. But, if you can fathom it out, then I’d be grateful. 

Now, all I need to do is find the time to apply to this site and the new busi­ness site. 

46 Responses to “Incremental leading”

  1. James Broad said on: June 15th, 2007 at 4:58 am

    I love the atten­tion to detail, some­thing that is what sep­ar­ates an ‘OK’ lay­out to an inspir­ing one. 

    I have to praise you also on tak­ing the time to visu­al­ise your findings!

  2. Mark Boulton said on: June 15th, 2007 at 5:00 am

    Thanks James. The­ory is one thing, but put­ting into prac­tice is another. I’ve yet to prac­tice what I preach with this one…

  3. James Broad said on: June 15th, 2007 at 5:05 am

    I know exactly what you mean. The amount of ‘best prac­tices’ and tech­niques I would love to imple­ment always tend to get pushed aside by time constraints/distractions. Its the know­ing how/why that excites me, though.

  4. GB said on: June 15th, 2007 at 5:36 am

    Yes, but what is what here? Red and green are the respect­ive line-heights, blue is baseline grid?

  5. Mark Boulton said on: June 15th, 2007 at 5:41 am

    GB: Yes, sorry, I was assum­ing that was obvious.

  6. Richard Rutter said on: June 15th, 2007 at 5:47 am

    One of the other recom­mend­a­tions I gave in the SxSW talk was to use plenty of decimal places in your CSS rules. This is because Safari will round to the nearest pixel, and so you want it to round in the right dir­ec­tion. In fact this is also a poten­tial prob­lem with Mark’s design above. The require­ment for line-height to be 14.4px works well in Gecko-based browsers, but Safari rounds down to 14px (even if the line-height is spe­cified in ems) and the desired rhythm is lost. 

    Safari does a lot of annoy­ing round­ing (also does it with per­cent­age widths).

  7. Jonno Riekwel said on: June 15th, 2007 at 5:52 am

    Really nice art­icle. Thanks a lot. I’ll use it daily.

  8. Mark Boulton said on: June 15th, 2007 at 5:56 am

    Richard Rut­ter: I’ve come across a few prob­lems with this. The the­ory is sound, but the imple­ment­a­tion in CSS is prov­ing to be tricky. To get a lar­ger decimal place value, it might be worth try­ing to align it 5:6, or 8:10, some­thing like that. 

    Good point though Rich.

  9. Luke Lutman said on: June 15th, 2007 at 6:54 am

    One thing I’ve run into is that dif­fer­ent fonts seem to have dif­fer­ent baselines, so any equa­tion for X, will go right out the win­dowif you set the side­bar in a dif­fer­ent font than the body (i.e. the body in a serif, and the side­bar in sans-serif). The dif­fer­ence is min­imal at small sizes, but pretty obvi­ous for head­ings and lar­ger stuff. 

    After get­ting the rhythm setup, I usu­ally use ‘pos­i­tion: rel­at­ive; top: Xem;’ to line it up by eye. Rel­at­ive pos­i­tion­ing is nice because it won’t affect ele­ments around (and espe­cially under) the one you’re adjuststing.

  10. GB said on: June 15th, 2007 at 7:46 am

    ok, I got it. I’ve tried with a few fonts and at many sizes, and Fire­fox puts the baseline at 2/3 of the line­height (approx.) 

    So let’s add ‘d’ which is the dis­tance between the top of the con­tain­ing ele­ment and the baseline. 

    d = 2a/3 = x + 2b/3 

    thus :

    x = (2a/3) — (2b/3)

    x = 2(a — b) / 3 

    where a and b are respect­ively the line­height of the main con­tent and the sidenote. 

    in this case; margin-top should be : 

    2(18px — 14.4px)/ 3 = 2.4 px 

    I’m let­ting it over to you to trans­form that to ems and to test it out :)

  11. Nate Klaiber said on: June 15th, 2007 at 8:18 am

    This is a nice addi­tion to an already inter­est­ing topic for the web. After read­ing Richard’s, and then later read­ing Wilson’s (and one from Jeff Croft along the way) — I was very intrigued. I am not a designer by trade, but there is some­thing about the ver­tical rhythm that really sets a page off. 

    Just when I thought I was get­ting good at the ver­tical rhythm with mul­tiple ele­ments on a page (images, head­ers, dif­fer­ent lay­outs, etc) — you go and throw another wrench in the scen­ario. Time to go play and work out my math skills. he. Thanks for the great article.

  12. Mark Boulton said on: June 15th, 2007 at 8:33 am

    GB: Thanks for the effort with that. How­ever, can we really assume that Fire­fox puts the baseline at 2/3 the line-height? 

    With the dif­fer­ences that exist between dif­fer­ent typefaces in terms of the des­cender val­ues and the baseline (and there­fore sub­sequent dif­fer­ences in the 2/3 value you’re talk­ing about) — can we really make those kinds of assumptions? 

    As nice as it would be.

  13. Abu said on: June 15th, 2007 at 9:16 am

    Thanks for this post. I too didn’t like the over-strecthed white space and went along with the com­ments at ALA that the side bar shouldn’t have to align itself along the same base line as the main text. 

    Your idea works as a good inbetween and i think we’ll use this as part of our site’s redesign.

  14. Wilson Miner said on: June 15th, 2007 at 9:39 am

    Ah, per­fect! I actu­ally do this a lot, I just left it out of the art­icle to keep things sim­pler. It’s also very handy for lists, which often can use some extra space between items, which it’s handy to add in half or quarter meas­ures. I’ll admit to hav­ing a bit of a haphaz­ard method for set­ting type down the page — in most cases I even­tu­ally end up just adding or remov­ing some space here and there. But it helps to do it in incre­ments so I know if I “fall off the grid” some­where I’ll even­tu­ally fall back on down the page.

  15. Lee Wilson said on: June 15th, 2007 at 10:06 am

    Thanks for the excel­lent addi­tion, I am actu­ally ‘study­ing’ the prin­ciples you, Richard and Khoi have put for­ward for what I will hope to be a design mas­ter piece, well, not quite. How­ever, regard­less of the out­come, I have gained vast amounts of know­ledge in terms of web typo­graphy and lay­out that I know will help me in the future. 

    I also pur­chased Robert Bringhurst’s book as well as Jan Tschichold. 

    Oh how much we weren’t taught at uni. Shame on you lecturers.

  16. GB said on: June 15th, 2007 at 11:35 am

    Mark : Ok, I looked into it a bit fur­ther, and, in the case of Fire­fox at least, text seems to be aligned on the ascender. The des­cender seems to have no effect.

    The ques­tion there­for seems to be : how is the first ascender posi­tioned, rel­at­ively to the top of the con­tain­ing ele­ment, and depend­ing on the line-height. 

    Hah.

  17. Martin said on: June 15th, 2007 at 5:03 pm

    Hm, looks pretty nice.

    Friend of mine try­ing to make some­thing like that… and noth­ing :)

    I will send him a link ;)

  18. Kilian Valkhof said on: June 16th, 2007 at 5:27 am

    I read the tran­scriptof your present­a­tion on Joe Clark’s web­site. Soun­ded like an inter­est­ing present­a­tion. This accom­pa­ny­ing art­icle is very cla­ri­fy­ing as well.

    when you use incre­mental lead­ing, you align, say, one in every four or one in every five.

    One ques­tion though, is the above just com­mon sense, “do-what-works”, or does it have some solid ground as well? (I.e. a cer­tain pro­por­tion between the two dif­fer­ent line heights is optimal?)

  19. Adam said on: June 16th, 2007 at 6:19 pm

    I love this in the­ory, but doesn’t all that work just go out the win­dowif the someone doesn’t have the typeface you spe­cified, and it defaults to another? Or are the rel­at­ive val­ues equal across typefaces?

  20. jennifer said on: June 16th, 2007 at 11:15 pm

    oh my — i star­ted freel­ance web design about a month ago (with a back­ground in arts admin and theatre). before i read that post i thought i had a lot to learn…i can see now it might just be easier to head back to school (except that life really gets in the way of that sort of plan)

  21. John Sutherland said on: June 17th, 2007 at 7:44 am

    Excel­lent post. I’ve been play­ing around with the whole type/CSS thing since I saw the slides of your SXSW presentation. 

    One thing that I’m unsure of (and I won­der if this is some­thing I’ve picked up on from Wilson’s com­ment above) but what hap­pens in the case where you change the rhythm to some­thing like 5:4 or 4:3 for lists in the body but the num­ber of items in the list pushes ele­ments fur­ther down the page out of rhythm?

  22. Lee Wilson said on: June 17th, 2007 at 10:01 am

    Don’t why I notice earlier but I have just read Richard Rut­ters comment. 

    “One of the other recom­mend­a­tions I gave in the SxSW talk was to use plenty of decimal places in your CSS rules.” 

    Richard: After being inspired by you and marks typo­graphy sucks present­a­tion, and your Com­pose to a Ver­tical Rhythm art­icle, I have decided to redo my web­site, with both lay­out and typo­graphy in ems (and even vec­tors too). 

    I just wanted to ask a ques­tion on the safari ems issue because I seem to be have a very slight mis-placement of divs. With the plenty of decim­als that you men­tion, how far should we go with this? I notice from the 24ways art­icle that you go up to 4 decim­als, this is some­thing I have done but still seem to be get­ting prob­lems, should I be using as many as the cal­cu­lator dishes out for my calculations? 

    Thanks

    Lee

  23. Kev Stone said on: June 17th, 2007 at 12:10 pm

    I always find align­ing the two to be tricky myself, if all else fails I simply resort to the ‘Line Guides’ avail­able in the Web Developer Tool­bar exten­sion for Fire­fox. It’s time con­sum­ing (as each time you refresh you have to reset the guides to the baseline), but it does the trick quite well.

  24. david said on: June 18th, 2007 at 3:53 am

    hmm. You say you are tak­ing influ­ence from print design but you aren’t actu­ally align­ing at all with the baseline grid. Your type should be sit­ting ON the grid­line. Not centered between baselines. That’s why it’s called a baseline grid ;)

  25. Lee Wilson said on: June 18th, 2007 at 3:58 am

    David, this is a com­mon prac­tice in edit­or­ial design, as Mark mentions. 

    It fits with the over­all lay­out and baseline because it snaps to the grid using a 5:4 ratio. 

    You may be miss­ing the point of the article.

  26. Mark Boulton said on: June 18th, 2007 at 3:59 am

    Kilian Valk­hof: The the­ory of this is sound, the impli­ment­a­tion how­ever is a bit shaky at present. With regards to best prac­tice with find­ing the right ratio, then it really is a suck it and see situation. 

    Adam: That’s a really valid point. This is based on the sid­e­note and main copy being the same typeface. If they were dif­fer­ent, then you’re right, the x-heights would be different. 

    John Suth­er­land: Wilson’s point is a good one. If you were set­ting this type in a print doc­u­ment, you would add extra lead­ing at the bot­tom of the list to ensure the type fol­low­ing would then align to the grid. You can do this on the web of course, but would have to be on a case by case basis, which doesn’t always work with dynam­ic­ally cre­ated content. 

    david: I’m well aware of that. If you’d read the last part of this post, you’d see that I men­tion about the x-height value and issues with align­ing baselines. This method is about as close as we can get on the web to a Baseline grid.

  27. bill said on: June 18th, 2007 at 4:02 am

    Does no one else find that lead­ing dif­fer­ently in safari and fire­fox? (haven’t tested on a PC and IE)

    I tested in Safari with a 18px guide grid as back­ground. All ok. But in Fire­fox there’s a ver­tical shift. Any ideas why this is?

  28. Lee Wilson said on: June 18th, 2007 at 4:04 am

    Ignore me, I see what David meant now. Thought he was ask­ing why the sid­e­note text wasn’t the same line-height as the reg­u­lar… sorry buddy. 

    Lee

  29. david said on: June 18th, 2007 at 4:14 am

    I still think the red lines you use as tra­di­tional baseline grid is con­fus­ing. The type should be sit­ting on the baseline.

    For example if you were align­ing graphic ele­ments with the baseline grid — like a 1px line rule or a photo you would be align­ing it with the baseline, sit­ting it on the line, not it’s center. 

    Are there dif­fer­ences between fire­fox and other browsers as regards lead­ing?  — I do find that a prob­lem. Per­haps you could next do a com­par­ison test to get a con­sist­ent lead­ing between them. Which browser should you start to use as your base tester?

  30. Mark Boulton said on: June 18th, 2007 at 4:31 am

    David: I get the feel­ing you’re a print designer right? 

    I never said this was a Baseline Grid. It’s type align­ing to a Ver­tical Rhythm. That rhythm is set to 18px and the type is aligned to it using line-height, not the baseline (as you can’t do that!). 

    I see where you’re com­ing from, but there is not way to rep­lic­ate a print-based baseline grid on the web. Yet. So, we have to stretch that idea — which is what Richard did last year, and I’m adding to here. 

    With regards to browsers, there are dif­fer­ences in how they render line-height if it’s an em-based meas­ure­ment. Richard sug­ges­ted using lots of decimal places in your val­ues and leave it up to the browser to work it out. Appar­ently, Safari rounds down to the nearest pixel which is why this may look a little ropey in Safari.

  31. david said on: June 18th, 2007 at 4:38 am

    yep — print designer ;) 

    So with the ‘Ver­tical Rhythm®’ you are try­ing to get roughly between the lines is that right? 

    Why is a baseline grid not pos­sible, if for example you were align­ing type to a back­round grid gif ? — 18px grid lines –18px line-height. etc.,

    Thats what I have been doing. 

    I’ve found slight dif­fer­ences between safari and fire­fox even using px in line-height. down to using px ? is using px a no-no ?

  32. Mark Boulton said on: June 18th, 2007 at 4:51 am

    Well, you can align it to a back­ground image sure. I’ve done that in the past too. How­ever, these tech­niques allow you to set the type to the Rhythm without hav­ing to do that.

    Using pixels isn’t a no-no. I find that using ems (as it’s a rela­tional typo­graphic meas­ure­ment) is bet­ter as when the type is res­ized, the typo­graphic rela­tion­ship is retained

  33. david said on: June 18th, 2007 at 5:01 am

    So how do non typo­graphic (pics, rules etc., ) ele­ments align with the ver­tical rhythm if you don’t have a visual guide? 

    (If ver­tical rhythm = ver­tical line space height

    as opposed to baseline grid which = baselines of type ) 

    - or would you still use a back­ground guide gif.

  34. Adam said on: June 18th, 2007 at 6:44 am

    “Adam: That’s a really valid point. This is based on the sid­e­note and main copy being the same typeface. If they were dif­fer­ent, then you’re right, the x-heights would be different.” 

    That’s actu­ally a dif­fer­ent valid point. I meant what if you line everything up with one of the new Win­dows fonts spe­cified. Then someone on a Mac views the site and it defaults to, say, Geor­gia. Wouldn’t all your effort be wasted?

  35. wdny said on: June 18th, 2007 at 5:51 pm

    Very use­ful inform­a­tion, thank you for post.

  36. Jermayn Parker said on: June 19th, 2007 at 8:56 pm

    WOW, remem­ber read­ing the art­icle on A list Apart but feel­ing empty after­wards, this def­in­itely helps and has helped filled me up :) 

    So thank you

  37. Dušan Smolnikar said on: June 22nd, 2007 at 2:42 am

    I some­times get a feel­ing that fire­fox does quite a bad job at round­ing some em units to pixels. Which leads to lines being aligned only within 1 or 2 pixel range. Is it just me, or has any­one else exper­i­enced the problem?

  38. irving feliz said on: June 23rd, 2007 at 5:11 pm

    What I usu­ally do about it is just hori­zont­ally align over the baseline the first lines of text between main con­tent column and sid­e­note column. Then align every first lines of text of the next para­graphs or nav in the sid­e­note column with any hori­zont­ally match­ing baseline of text from the main con­tent column. 

    If the next con­tent in the sid­e­note column is an ad box, poll box, or an image, etc., then I try to align it with any hori­zont­ally cor­res­pond­ing x-height line of text from the main con­tent column —instead of its baseline. That way I think can get, at least optic­ally, ver­tical rhythm without miss­ing some crit­ical dead­line —or my san­ity, con­sid­er­ing how obsess­ive one may get with stuff like that. 

    It’s always a trade-off, and I per­son­ally prefer this solu­tion to end up with a dis­turb­ing sid­e­note with too much lead­ing, except, obvi­ously, in those cases where you delib­er­ately want that much line-height as part of the design to, lets say, give a sense of light­ness, or accen­tu­ate a par­tic­u­lar text area. Some­times I’ve man­aged to use incre­mental lead­ing though, but with little con­sist­ency between browsers. 

    Given the visual ren­der­ing incon­sist­en­cies between browsers / plat­forms / ver­sions + user set­tings / pref­er­ences, I think we are pretty much screwed.

  39. LucaPost said on: June 26th, 2007 at 9:54 am

    I do agree that sid­e­notes look much bet­ter in a smal­ler font and with a nar­rower line-height; but I think this is way too ‘fra­gile’ to main­tain throughtout a website! 

    if you just scale the font-size and the line-height of the sid­e­note accord­ing to your ‘Typo­graphic Hier­archy — size’ art­icle; then the sid­e­note will match the main body lines every few lines anyhow ! 

    then we can talk about ‘emer­gent beha­viour’ & ‘self-organization’ stem­ming from a gen­eral principle !

  40. Tom said on: June 27th, 2007 at 10:49 pm

    thanks Mark, you’re like Joseph Muller-Brockmann for the web!

  41. Jack said on: June 28th, 2007 at 6:25 am

    Mark,

    I’d like to thank you for this and all your other art­icles. If you’re work­ing on a site design would you actu­ally fol­low these rules in your pho­toshop lay­outs or do you only focus on such things when build time comes around? 

    J

  42. timfm said on: June 29th, 2007 at 7:12 pm

    Irving said:

    “If the next con­tent in the sid­e­note column is an ad box, poll box, or an image, etc., then I try to align it with any hori­zont­ally cor­res­pond­ing x-height line of text from the main con­tent column —instead of its baseline.”

    Wouldn’t you want to align it with the ascender or cap-height of the main con­tent? I believe that’s what Müller-Brockmann recom­mends in Grid Sys­tems

  43. vitali said on: July 1st, 2007 at 2:22 pm

    i’m lern­ing CSS, whit my homepage and read all wat i kann find. thanks ! 

    is very interesst­ing Infomation!

  44. Kiblerly said on: July 4th, 2007 at 6:15 am

    not bad art­icle! And look how many people are inter­ested in it! But hon­esty… Where are some new topics?!

  45. Graduate education said on: July 4th, 2007 at 9:42 am

    Nice art­icle. Thanks!

  46. Mark Boulton: Incremental Leading on the Web « 4030 (or 2030): Dispatches from the Future said on: September 28th, 2009 at 4:02 pm

    […] Read Mark’s art­icle here. […]

  • Me

    Hello. My name is Mark Boulton. I’m a designer, an author, a speaker and I run a small design agency where we work with lovely cli­ents and pub­lish books as we go. This is my blog.

  • More of me

  • Publications

    Design­ing for the Web
    Start­ing from £19 + VAT for a PDF Down­load. £29 for a full col­our paperback.
  • Where I work

    Mark Boulton Design
    A small design stu­dio doing good things for nice clients.
    Five Simple Steps
    Pub­lish­ing easy to read design books.
  • See me speak

    @Media 2010
    June 8th — 11th, Lon­don, UK.
    Drupal­Con 2010
    August 23th — 27th, Copen­ha­gen, Denmark.
    dCon­struct 2010: Design 1010 workshop
    Septem­ber 1st, Brighton, UK.
    Web­d­a­gene
    Septem­ber 29th — Octo­ber 1st, Oslo, Norway
    Web Developers Conference
    Octo­ber 27th, Bris­tol, UK.
    New Adven­tures in Web Design
    Janu­ary 20th 2011, Not­ting­ham, UK.
  • Copyright © 1999–2010 Mark Boulton. Made with an Apple Mac in Wales. Running on WordPress and VPS.net.