Hi Ben, It seems that the short answer to your question is a base line-height of 0.8 (yup, unitless). My guess would have been the value 1 but I don't know enough about browser default styles to say why 0.8 seems to work. I've only checked this using IE8 and Firefox 3.5 using the developer tool bar, so there's a fair chance I'm talking crap, but it's probably an avenue worth investigating.
As with so many things CSS my knowledge comes directly from Eric Meyer, so I'll link his site. http://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/ Cheers, Ant From: li...@webstandardsgroup.org [mailto:li...@webstandardsgroup.org] On Behalf Of Ben Lau Sent: 01 July 2009 16:20 To: wsg@webstandardsgroup.org Subject: [WSG] working with line-height Hi list, I frequently have to work with pixel-perfect design, and I'm always having trouble with line-height in particular. Please take a look at this example: http://www.hellobenlau.net/wsg/index.html I'm wondering if there was a way to top align the text to its line-height. So say, with text size 20px, could the top of the 'T' be aligned to the top of the pink box? How does the 'gap' above and below the text gets calculated? Thanks Ben [] ******************************************************************* List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: memberh...@webstandardsgroup.org ******************************************************************* ________________________________ IMPORTANT NOTICE: This email contains proprietary information, some or all of which may be legally privileged. It is for the intended recipient only. If an addressing or transmission error has misdirected this email, please notify the author by replying to this email. If you are not the intended recipient you must not use, disclose, distribute, copy, print or rely on this email. In addition you must erase all information contained in this email immediately after notifying the author. No liability is accepted for viruses and it is your responsibility to scan attachments (if any). Unless related to the business of the firm, the opinions expressed within this email are the opinions of the sender and do not necessarily constitute those of Conscia Enterprise Systems Ltd, whose registered address is 280 St Vincent Street, Glasgow, G2 5RL, United Kingdom. ******************************************************************* List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: memberh...@webstandardsgroup.org *******************************************************************