<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: line-height: abnormal</title>
	<atom:link href="http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/feed/" rel="self" type="application/rss+xml" />
	<link>http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/</link>
	<description>Things that Eric A. Meyer, CSS expert, writes about on his personal Web site; it&#039;s largely Web standards and Web technology, but also various bits of culture, politics, personal observations, and other miscellaneous stuff</description>
	<lastBuildDate>Fri, 19 Mar 2010 00:27:46 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: The Firefox Input Button Line-Height Bug</title>
		<link>http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-493429</link>
		<dc:creator>The Firefox Input Button Line-Height Bug</dc:creator>
		<pubDate>Thu, 25 Feb 2010 22:21:16 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-493429</guid>
		<description>[...] their part, particularly considering (as Eric Meyer has pointed out at great and detailed length), line-height: normal is anything but.And while trying to work around this rule, I discovered something that makes the situation a little [...]</description>
		<content:encoded><![CDATA[<p>[...] their part, particularly considering (as Eric Meyer has pointed out at great and detailed length), line-height: normal is anything but.And while trying to work around this rule, I discovered something that makes the situation a little [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Brown</title>
		<link>http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-492026</link>
		<dc:creator>Bill Brown</dc:creator>
		<pubDate>Mon, 08 Feb 2010 16:26:15 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-492026</guid>
		<description>Please ignore my previous post.

The solution I posted does NOT solve the problem. An !important rule in the User Agent style sheet cannot be over-ridden by an author style sheet.

As of 2010-FEB-08 (and as far as I know), there remains no solution.

Bill</description>
		<content:encoded><![CDATA[<p>Please ignore my previous post.</p>
<p>The solution I posted does NOT solve the problem. An !important rule in the User Agent style sheet cannot be over-ridden by an author style sheet.</p>
<p>As of 2010-FEB-08 (and as far as I know), there remains no solution.</p>
<p>Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Brown</title>
		<link>http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-491820</link>
		<dc:creator>Bill Brown</dc:creator>
		<pubDate>Fri, 05 Feb 2010 18:30:14 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-491820</guid>
		<description>Hi, Eric,

As usual, I stmbled across your site today while surfing for a CSS solution. My problem was with Firefox/Win. I&#039;m on Ubuntu, and oddly enough, the issue doesn&#039;t exist there.

I&#039;m developing an Armenian/English translator and I noticed that FF/Win was chopping off the bottoms of some of the Armenian glyphs in text input boxes. I assumed a line-height:1.5 rule would help, but quickly noticed that Firefox was ignoring any line-height settings on input elements.

A quick check in Firebug revealed that the FF/Win style sheet is declaring input{line-height:normal!important;}.

Re-declaring !important and over-specifying the selector, I changed the style sheet on the site to this:
:root input[type=text]{line-height:1.5!important;}
...which fixed the problem.

I&#039;m posting it here since this page came up during my Google search and anybody searching in the future might benefit from this tidbit. Hope you don&#039;t mind. :)
--Bill</description>
		<content:encoded><![CDATA[<p>Hi, Eric,</p>
<p>As usual, I stmbled across your site today while surfing for a CSS solution. My problem was with Firefox/Win. I&#8217;m on Ubuntu, and oddly enough, the issue doesn&#8217;t exist there.</p>
<p>I&#8217;m developing an Armenian/English translator and I noticed that FF/Win was chopping off the bottoms of some of the Armenian glyphs in text input boxes. I assumed a line-height:1.5 rule would help, but quickly noticed that Firefox was ignoring any line-height settings on input elements.</p>
<p>A quick check in Firebug revealed that the FF/Win style sheet is declaring input{line-height:normal!important;}.</p>
<p>Re-declaring !important and over-specifying the selector, I changed the style sheet on the site to this:<br />
:root input[type=text]{line-height:1.5!important;}<br />
&#8230;which fixed the problem.</p>
<p>I&#8217;m posting it here since this page came up during my Google search and anybody searching in the future might benefit from this tidbit. Hope you don&#8217;t mind. :)<br />
&#8211;Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anonymous</title>
		<link>http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-457628</link>
		<dc:creator>anonymous</dc:creator>
		<pubDate>Wed, 22 Apr 2009 19:07:32 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-457628</guid>
		<description>i&#039;m confused. united line-height can cause text overlap, while unitless/multiplier can break vertical rhythm. if unitless line-height is being advocated, how do you recommend avoiding breaking vertical rhythm?</description>
		<content:encoded><![CDATA[<p>i&#8217;m confused. united line-height can cause text overlap, while unitless/multiplier can break vertical rhythm. if unitless line-height is being advocated, how do you recommend avoiding breaking vertical rhythm?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Williams</title>
		<link>http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-456262</link>
		<dc:creator>Robert Williams</dc:creator>
		<pubDate>Fri, 17 Apr 2009 19:14:01 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-456262</guid>
		<description>Hinting may be effecting the line height. There are vertical hints in fonts. If it is, then the line height may also change depending on which what letters you use and if anti-aliasing is turned off or on.</description>
		<content:encoded><![CDATA[<p>Hinting may be effecting the line height. There are vertical hints in fonts. If it is, then the line height may also change depending on which what letters you use and if anti-aliasing is turned off or on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric&#8217;s Archived Thoughts: line-height: abnormal &#124; CSS Tutorials - CSSHelper.net</title>
		<link>http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-449108</link>
		<dc:creator>Eric&#8217;s Archived Thoughts: line-height: abnormal &#124; CSS Tutorials - CSSHelper.net</dc:creator>
		<pubDate>Thu, 19 Mar 2009 09:27:31 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-449108</guid>
		<description>[...] Source [...]</description>
		<content:encoded><![CDATA[<p>[...] Source [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Lee Finney</title>
		<link>http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-415403</link>
		<dc:creator>Michael Lee Finney</dc:creator>
		<pubDate>Tue, 14 Oct 2008 10:11:29 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-415403</guid>
		<description>I have found that if I select a font with &quot;font-size: #px&quot; that the font that I get back has ascender + descender = #, which is also the height that I get from using line-height:100%. If I then use line-height:normal I get ## = ascender + descender + internalLeading + externalLeading where the externalLeading component is added by some browsers and not by others. It is zero for most fonts. Typically I have found a pixel or two variation in line-height:normal result, but it is very close between several browsers and across several dozen fonts and handfull of font sizes. I found only one case where line-height:normal &lt; line-height:100% and that was where the font had a garbage value for the internalLeading value. There are some fonts with internalLeading = 0 and in that case line-height:100% = line-height:normal unless the externalLeading is non-zero, which doesn&#039;t affect all browsers. The minor variations I get are probably due to round-off, fudge factors and slight differences in font matching results. However, this seems to be extremely consistent.</description>
		<content:encoded><![CDATA[<p>I have found that if I select a font with &#8220;font-size: #px&#8221; that the font that I get back has ascender + descender = #, which is also the height that I get from using line-height:100%. If I then use line-height:normal I get ## = ascender + descender + internalLeading + externalLeading where the externalLeading component is added by some browsers and not by others. It is zero for most fonts. Typically I have found a pixel or two variation in line-height:normal result, but it is very close between several browsers and across several dozen fonts and handfull of font sizes. I found only one case where line-height:normal &lt; line-height:100% and that was where the font had a garbage value for the internalLeading value. There are some fonts with internalLeading = 0 and in that case line-height:100% = line-height:normal unless the externalLeading is non-zero, which doesn&#8217;t affect all browsers. The minor variations I get are probably due to round-off, fudge factors and slight differences in font matching results. However, this seems to be extremely consistent.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Lee Finney</title>
		<link>http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-415372</link>
		<dc:creator>Michael Lee Finney</dc:creator>
		<pubDate>Tue, 14 Oct 2008 05:22:17 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-415372</guid>
		<description>I have been looking at the font-height issue also because I want to extract font-metrics in JavaScript. I have found that line-height:normal gives just enough vertical space to display all of the characters. If you display a box drawing character plus an open bracket or brace typically there is one pixel above and below the black space. Obviously that may vary a bit, but if you want the metrics then line-height:normal gives the minimum height you need to display a line of text without overlap.</description>
		<content:encoded><![CDATA[<p>I have been looking at the font-height issue also because I want to extract font-metrics in JavaScript. I have found that line-height:normal gives just enough vertical space to display all of the characters. If you display a box drawing character plus an open bracket or brace typically there is one pixel above and below the black space. Obviously that may vary a bit, but if you want the metrics then line-height:normal gives the minimum height you need to display a line of text without overlap.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mnemonic</title>
		<link>http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-394259</link>
		<dc:creator>Mnemonic</dc:creator>
		<pubDate>Sat, 19 Jul 2008 22:36:35 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-394259</guid>
		<description>Re:  &quot;Update 7 May 08: I&quot;ve updated the test page with a fix from Ben Lowery so that it works in IE...&quot;

It doesn&#039;t work in 6.0.2900.....</description>
		<content:encoded><![CDATA[<p>Re:  &#8220;Update 7 May 08: I&#8221;ve updated the test page with a fix from Ben Lowery so that it works in IE&#8230;&#8221;</p>
<p>It doesn&#8217;t work in 6.0.2900&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hangfromthefloor</title>
		<link>http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-377662</link>
		<dc:creator>hangfromthefloor</dc:creator>
		<pubDate>Thu, 22 May 2008 01:34:24 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-377662</guid>
		<description>Anybody notice anything strange with line-spacing and Cambria Math?</description>
		<content:encoded><![CDATA[<p>Anybody notice anything strange with line-spacing and Cambria Math?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tor Hershman</title>
		<link>http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-376772</link>
		<dc:creator>Tor Hershman</dc:creator>
		<pubDate>Sun, 18 May 2008 22:07:42 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-376772</guid>
		<description>And for the others, if any, that have no idea what &#039;rugose&#039; means.....

http://www.thefreedictionary.com/rugose

Stay on groovin&#039; (Say what?) safari,
Tor</description>
		<content:encoded><![CDATA[<p>And for the others, if any, that have no idea what &#8216;rugose&#8217; means&#8230;..</p>
<p><a href="http://www.thefreedictionary.com/rugose" rel="nofollow">http://www.thefreedictionary.com/rugose</a></p>
<p>Stay on groovin&#8217; (Say what?) safari,<br />
Tor</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CSS Collection &#187; Blog Archive &#187; line-height: abnormal</title>
		<link>http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-376107</link>
		<dc:creator>CSS Collection &#187; Blog Archive &#187; line-height: abnormal</dc:creator>
		<pubDate>Fri, 16 May 2008 13:49:31 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-376107</guid>
		<description>[...] the great CSS master, Eric Meyer, gets frustrated with line layout. He thinks out loud about line-height: normal, which is more like abnormal. Take a look.  Friday, May 16th &#124; [...]</description>
		<content:encoded><![CDATA[<p>[...] the great CSS master, Eric Meyer, gets frustrated with line layout. He thinks out loud about line-height: normal, which is more like abnormal. Take a look.  Friday, May 16th | [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Great Resources Elsewhere: May 08 to May 15 - CSSnewbie</title>
		<link>http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-376027</link>
		<dc:creator>Great Resources Elsewhere: May 08 to May 15 - CSSnewbie</dc:creator>
		<pubDate>Fri, 16 May 2008 07:02:06 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-376027</guid>
		<description>[...] Eric&#8217;s Archived Thoughts: line-height: abnormal [...]</description>
		<content:encoded><![CDATA[<p>[...] Eric&#8217;s Archived Thoughts: line-height: abnormal [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Links of Interest - CSS-Tricks</title>
		<link>http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-375303</link>
		<dc:creator>Links of Interest - CSS-Tricks</dc:creator>
		<pubDate>Wed, 14 May 2008 12:45:41 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-375303</guid>
		<description>[...] Meyer digs into some of the peculiarities of line-height: Here&quot;s the punchline: the effects of declaring [...]</description>
		<content:encoded><![CDATA[<p>[...] Meyer digs into some of the peculiarities of line-height: Here&#8221;s the punchline: the effects of declaring [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Smokey Ardisson</title>
		<link>http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-375051</link>
		<dc:creator>Smokey Ardisson</dc:creator>
		<pubDate>Tue, 13 May 2008 18:55:48 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-375051</guid>
		<description>&lt;blockquote cite=&quot;http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-373387&quot;&gt;2. Thanks for the bug 399636 reference. I&quot;ll argue that what Gecko does is deeply unexpected, and very possibly incorrect. If I go into any text editor, set the font to “Webdings”, and type “Oy!”, I&quot;ll get three symbols---the glyphs defined in that font for the characters I input. In Gecko 1.9, I get substitutes from an entirely different and unrelated font face. That makes very, very little sense to me (and, I&quot;d wager, to almost anyone).&lt;/blockquote&gt;
What Gecko 1.9 does is absolutely correct and expected in a Unicode world.  If this were 1990, I&quot;d (possibly) agree with your statement, but not in a Unicode world.  When you typed “Oy!”, you requested the glyphs for “O” “y” and “!”, not those for “ear”, “circle with a horizontal line through the center”, and “spider”[1].  If Webdings does not contain the glyphs “O” “y” and “!”, then the application should select another font that does contain those glyphs in order to display “Oy!” properly.  Gecko 1.9 does this. 

Changing a font face should &lt;em&gt;never&lt;/em&gt; change the glyph displayed.  Unicode requires every glyph to have a unique “id”, and the only way to display that glyph is to use its id; interoperability (and machine comprehensibility) depends on it.  Or, put another way, think of the glyphs like HTML structure and the font face as CSS presentation; if I have a &lt;p&gt; element somewhere and I change the font-size for that &lt;p&gt; in CSS, that doesn&quot;t suddenly turn the &lt;p&gt; into an &lt;h1&gt; element.

By the way, I don&quot;t know what text editor you&quot;re using, but in any Unicode-based application, changing the font to Webdings and typing “Oy!” produces the glyphs “Oy!” (try in TextEdit on Mac OS X, for instance).

[1] As long as you didn&quot;t first switch to a dingbats keyboard layout; if you used a Unicode dingbats layout to request the Unicode glyphs for “ear”, “circle with a horizontal line through the center”, and “spider” (or whatever they may be called), you should see those glyphs provided you have a font that contains them.</description>
		<content:encoded><![CDATA[<blockquote cite="http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-373387"><p>2. Thanks for the bug 399636 reference. I&#8221;ll argue that what Gecko does is deeply unexpected, and very possibly incorrect. If I go into any text editor, set the font to “Webdings”, and type “Oy!”, I&#8221;ll get three symbols&#8212;the glyphs defined in that font for the characters I input. In Gecko 1.9, I get substitutes from an entirely different and unrelated font face. That makes very, very little sense to me (and, I&#8221;d wager, to almost anyone).</p></blockquote>
<p>What Gecko 1.9 does is absolutely correct and expected in a Unicode world.  If this were 1990, I&#8221;d (possibly) agree with your statement, but not in a Unicode world.  When you typed “Oy!”, you requested the glyphs for “O” “y” and “!”, not those for “ear”, “circle with a horizontal line through the center”, and “spider”[1].  If Webdings does not contain the glyphs “O” “y” and “!”, then the application should select another font that does contain those glyphs in order to display “Oy!” properly.  Gecko 1.9 does this. </p>
<p>Changing a font face should <em>never</em> change the glyph displayed.  Unicode requires every glyph to have a unique “id”, and the only way to display that glyph is to use its id; interoperability (and machine comprehensibility) depends on it.  Or, put another way, think of the glyphs like HTML structure and the font face as CSS presentation; if I have a &lt;p&gt; element somewhere and I change the font-size for that &lt;p&gt; in CSS, that doesn&#8221;t suddenly turn the &lt;p&gt; into an &lt;h1&gt; element.</p>
<p>By the way, I don&#8221;t know what text editor you&#8221;re using, but in any Unicode-based application, changing the font to Webdings and typing “Oy!” produces the glyphs “Oy!” (try in TextEdit on Mac OS X, for instance).</p>
<p>[1] As long as you didn&#8221;t first switch to a dingbats keyboard layout; if you used a Unicode dingbats layout to request the Unicode glyphs for “ear”, “circle with a horizontal line through the center”, and “spider” (or whatever they may be called), you should see those glyphs provided you have a font that contains them.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head profile="http://gmpg.org/xfn/1">
<title>meyerweb.com</title>
<link rel="openid.server" href="http://www.myopenid.com/server">
<link rel="openid.delegate" href="http://emeyer.myopenid.com/">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link rel="shortcut icon" href="/favicon.ico"><link rel="home" href="http://meyerweb.com/" title="Home" ><link rel="stylesheet" href="http://meyerweb.com/ui/meyerweb.css" type="text/css" media="screen, projection"><link rel="stylesheet" href="http://meyerweb.com/ui/theme.css" type="text/css" media="screen, projection" id="themeLink"><link rel="stylesheet" href="http://meyerweb.com/ui/print.css" type="text/css" media="print"><script src="http://meyerweb.com/ui/addresses.js" type="text/javascript"></script><link rel="stylesheet" href="/ui/wordpress.css" type="text/css" media="screen">
<link rel="stylesheet" href="/ui/tfe.css" type="text/css" media="screen">
<link rel="stylesheet" href="/ui/home.css" type="text/css" media="screen">
<link rel="alternate" type="application/rss+xml" title="Thoughts From Eric" href="/eric/thoughts/rss2/full" />
<link rel="alternate" type="application/rss+xml" title="Thoughts From Eric (only technical posts)" href="/eric/thoughts/category/tech/rss2/full" />
<link rel="alternate" type="application/rss+xml" title="Thoughts From Eric (only personal posts)" href="/eric/thoughts/category/personal/rss2/full" />
<link rel="alternate" type="application/rss+xml" title="Distractions" href="/eric/thoughts/recent-links/rss2" />
<link rel="alternate" type="application/rss+xml" title="Excuse of the Day" href="/feeds/excuse/rss20.xml" />
</head>
<body id="www-meyerweb-com" class="hpg">

<div id="sitemast"><h1><a href="/"><span>meyerweb</span>.com</a></h1></div><div id="search"><h4>Exploration</h4><!-- SiteSearch Google --><form method="get" action="http://www.google.com/custom" target="_top"><div><input type="hidden" name="domains" value="meyerweb.com"></input><label for="sbb" style="display: none">Submit search form</label><input type="submit" name="sa" value="Google Search" id="sbb"></input><label for="sbi" style="display: none">Enter your search terms</label><input type="text" name="q" size="31" maxlength="255" value="" id="sbi"></input><p><input type="radio" name="sitesearch" value="meyerweb.com" checked id="ss1"></input><label for="ss1" title="Search meyerweb.com">meyerweb.com</label><input type="radio" name="sitesearch" value="" id="ss0"></input><label for="ss0" title="Search the Web">Web</label></p><input type="hidden" name="client" value="pub-3772084027748653"></input><input type="hidden" name="forid" value="1"></input><input type="hidden" name="ie" value="ISO-8859-1"></input><input type="hidden" name="oe" value="ISO-8859-1"></input><input type="hidden" name="safe" value="active"></input><input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1"></input><input type="hidden" name="hl" value="en"></input></div></form><!-- SiteSearch Google --><!-- <form method="get" action="http://www.google.com/custom"><div><input type="submit" name="sa" value="Search"><input type="text" name="q" size="20" maxlength="255" value=""><input type="hidden" name="sitesearch" value="meyerweb.com"></div></form><small><a href="http://www.google.com/search">Powered by Google</a></small> --></div><div id="main"><div class="skipper">Skip to: <a href="#extra">site navigation/presentation</a></div><div class="skipper">Skip to: <a href="#thoughts">Thoughts From Eric</a></div>
<div id="thoughts">


<div class="entry">
<h3><a href="http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/" rel="bookmark" title="Permanent Link: line-height: abnormal">line-height: abnormal</a></h3>
<ul class="meta">
<li class="date">Tue 6 May 2008</li>
<li class="time">1113</li>
<li class="cat"><a href="http://meyerweb.com/eric/thoughts/category/tech/browsers/" title="View all posts in Browsers" rel="category tag">Browsers</a><br> <a href="http://meyerweb.com/eric/thoughts/category/tech/css/" title="View all posts in CSS" rel="category tag">CSS</a><br> <a href="http://meyerweb.com/eric/thoughts/category/tech/standards/" title="View all posts in Standards" rel="category tag">Standards</a></li>
<li class="cmt"><a href="http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comments">58 responses</a></li>
<li></li><li></li></ul>

<div class="text">
<p>
When I first wrote <a href="http://meyerweb.com/eric/books/css-tdg/"><cite>Cascading Style Sheets: The Definitive Guide</cite></a>, the part that caused me the most difficulty and headaches was the line layout material.  Several times I was sure I had it all figured out and accurately described, only to find out I was wrong.  For two weeks I corresponded with <a href="http://hixie.ch/" rel="acquaintance colleague met">Ian Hickson</a> and <a href="http://dbaron.org/" rel="acquaintance colleague met">David Baron</a>, arguing for my understanding of things and having them show me, in merciless detail, how I was wrong.  I doubt that I will ever stop owing them for their dedication to getting me through the wilderness of my own misunderstandings.
</p>
<p>
Later on, I produced <a href="http://meyerweb.com/eric/css/inline-format.html">a terse description of line layout</a> which went through a protracted vetting process with the CSS Working Group and the members of <a href="http://lists.w3.org/Archives/Public/www-style/">www-style</a>.  At the time it was published, there was no more detailed and accurate description of line layout available.  Even at that, corrections trickled in over the years, which made me think of it as my own tiny little <a href="http://en.wikipedia.org/wiki/The_Art_of_Computer_Programming"><cite>The Art of Computer Programming</cite></a>.  Only without the small monetary reward for finding errors.
</p>
<p>
The point here is that line layout is very difficult to truly understand&#8212;even given everything I just said, I&#8217;m still not convinced that I do&#8212;and that there are often surprises lurking for anyone who goes looking into the far corners of how it happens.  As I&#8217;ve said before, my knowledge of what goes into the layout of lines of text imparts a sense of astonishment that any page can be successfully displayed in less than the projected age of the universe.
</p>
<p>
Why bring all this up?  Because I went and poked <code>line-height: normal</code> with a stick, and found it to be both squamous and rugose.  As with all driven to such madness, I now seek, grinning wildly, to infect others.
</p>
<p>
Here&#8217;s the punchline: the effects of declaring <code>line-height: normal</code> not only vary from browser to browser, which I had expected&#8212;in fact, quantifying those differences was the whole point&#8212;<em>but they also vary from one font face to another, and can also vary within a given face</em>.
</p>
<p>
I did not expect that.  At least, not consciously.
</p>
<p>
My work, let me show it to you: <a href="http://meyerweb.com/eric/css/tests/line-height/inspect-multi.html">a JavaScript-driven test file</a> where you can pick from a list of fonts and see what happens at a variety of sizes.  (Yes, the JS is completely obtrusive; and yes, the JS is the square of amateur hour.  Let&#8217;s move on, please.  I&#8217;m perfectly happy to replace what&#8217;s there with unobtrusive and sharper JS, as long as the basic point of the page, which is testing <code>line-height: normal</code>, is not compromised.  Again, moving on.)
</p>
<p>
When you first go to the test, you should (I hope) see a bunch of rulered boxes containing text using the very common font face Webdings, set at a bunch of different font sizes.  The table shows you how tall the simple line boxes are at each size, and therefore the numeric equivalent for <code>line-height: normal</code> at those sizes.  So if a line box is using <code>font-size: 50px</code> and the line box is 55 pixels tall, the numeric equivalent for <code>line-height: normal</code> is 1.1 (55 divided by 50).
</p>
<p>
On my PowerBook, Webdings always yields a 1:1 ratio between the <code>font-size</code> and line box height.  The ten-pixel font size yields a ten-pixel-tall line box, and so on.
</p>
<p>
This is actually a little surprising by itself.  <a href="http://www.w3.org/TR/CSS21/visudet.html#propdef-line-height">The CSS 2.1 specification says</a>:
</p>

<blockquote cite="http://www.w3.org/TR/CSS21/visudet.html#propdef-line-height">
<dl>
<dt><strong>normal</strong></dt>
<dd>Tells user agents to set the used value to a &#8220;reasonable&#8221; value based on the font of the element. The value has the same meaning as <a name="x23" href="http://www.w3.org/TR/CSS21/syndata.html#value-def-number" class="noxref">&lt;number&gt;</a>. We recommend a used value for &#8216;normal&#8217; between 1.0 to 1.2. The <a href="http://www.w3.org/TR/CSS21/cascade.html#computed-value">computed value</a> is &#8216;normal&#8217;.
</dd>
</dl>
</blockquote>

<p>
This is basically what CSS has said since its first days (see the equivalent text <a href="http://www.w3.org/TR/CSS1#line-height">in CSS1</a> or <a href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">in CSS2</a> for confirmation) and there&#8217;s always been a widespread assumption that, since 1.0 is probably too crowded, something around 1.2 is much more likely.
</p>
<p>
So finding a value of 1 was a surprise.  It was an even bigger surprise to me that this held true in Camino 1.5.2, Firefox 2.0.0.14, and Safari 2.0.4, all on OS X.  Firefox 3b5 didn&#8217;t render Webdings at all, so I don&#8217;t know if it would do the same.  I actually suspect not, for reasons best left for another time (and, possibly, a final release of Firefox 3).
</p>
<p>
Various browsers doing the same thing in an under-specified area of the spec?  That can&#8217;t be right.  It&#8217;s pretty much an article of faith that given the chance to do <em>anything</em> differently, browsers will.  The sailing was so unexpectedly smooth that I immediately assumed was that a storm lurked just over the horizon.
</p>
<p>
Well, I was right.  All I had to do was start picking other font faces.
</p>
<p>
To start, I picked the next font on the list, Times New Roman, and the equivalent values for <code>normal</code> immediately changed.  In other words, <em>the numeric equivalents for Times New Roman are different than those for Webdings</em>.  The browsers weren&#8217;t maintaining a specific value for <code>normal</code>, but were altering it on a per-face basis.
</p>
<p>
Now, this is legal, given the way <code>normal</code> is under-specified.  There&#8217;s room to allow for this behavior.  It&#8217;s actually, once you think about it, a fairly good thing from a visual point of view: the best default line height for Times New Roman is probably not the best default line height for Courier New.  So while I was initially surprised, I got over it quickly.  The seemingly obvious conclusion was that browsers were actually respecting the fonts&#8217; built-in metrics.  This was reinforced when I found that the results were exactly the same from browser to browser.
</p>
<p>
Then I looked more closely at the numbers, and confusion set back in.  For Times New Roman, I was getting values of 1.1, 1.12, 1.16, 1.15, 1.149, and 1.1499.  If you were to round all of those numbers to two decimal points, you&#8217;d get 1.10, 1.12, 1.16, 1.15, 1.15, 1.15.  If you round them all to one decimal place, you&#8217;d get 1.1, 1.1, 1.2, 1.2, 1.1, 1.1.  They&#8217;re inconsistent.
</p>
<p>
But wait, I thought, I&#8217;m trying to compare numbers I derived by dividing pixels by pixels.  Let&#8217;s turn it around.  If I multiply the most precise measurement I&#8217;ve gotten by the various font sizes, I get&#8230; carry the two&#8230; 11.499, 28.7475, 57.495, 114.99, 1149.9, 11499.  As compared to the actual values I got, which were 11, 28, 58, 115, 1149, and 11499.
</p>
<p>
Which means the results were inappropriately rounded up in some cases and down in others.  28.7475 became 28 and 1149.9 became 1149, whereas 57.495 became 58.  Even though 11.499 became 11 and 114.99 became 115.
</p>
<p>
This was consistent across all the browsers I was testing.  So again, I was suspecting the fonts themselves.
</p>
<p>
And then I switched from Times New Roman to just plain old Times, and the storm was full upon me.  I&#8217;ll give you the results in a table.
</p>

<table class="chart">
<caption>Derived <code>normal</code> equivalents for Times in OS X browsers</caption>
<tr>
<th><code>font-size</code></th>
<th scope="col">Camino 1.5.2</th>
<th scope="col">Firefox 2.0.0.14</th>
<th scope="col">Safari 2.0.4</th>
</tr>
<tr>
<th scope="row">10
<td>1</td>
<td>1.2</td>
<td>1.3</td>
</th></tr>
<tr>
<th scope="row">25
<td>1</td>
<td>1</td>
<td>1.16</td>
</th></tr>
<tr>
<th scope="row">50
<td>1</td>
<td>1</td>
<td>1.18</td>
</th></tr>
<tr>
<th scope="row">100
<td>1</td>
<td>1</td>
<td>1.15</td>
</th></tr>
<tr>
<th scope="row">1000
<td>1</td>
<td>1</td>
<td>1.15</td>
</th></tr>
<tr>
<th scope="row">10000
<td>1</td>
<td>1</td>
<td>1.15</td>
</th></tr>
</table>

<p>
Much the same happened when comparing Courier New with plain old Courier: full consistency on Courier New between browsers, albeit with the same strange (non-)rounding effects as seen with Times New Roman; but inconsistency between browsers on plain Courier&#8212;with Camino yielding a flat 1 down the line, Firefox going from 1.2 to 1, and Safari having a range of values above the others&#8217; values.
</p>
<p>
Squamous!  Not to mention rugose!
</p>
<p>
Now it&#8217;s time for the stunning conclusion that derives from all this information, which is: not here.  Sorry.  So far all I have are observations.  I may turn all this into a summary page which shows the results for all the font faces across multiple browsers and platforms, but first I&#8217;ll need to get those numbers.
</p>
<p>
I do have a few speculations, though:
</p>

<ol>
<li>
<p>
Firefox&#8217;s inconsistency within font faces (see Times and Courier, above) may come from face substitution.  That&#8217;s when a browser doesn&#8217;t have a given character in a given face, so it looks for a substitute in another face.  If Firefox thinks it doesn&#8217;t have 10-pixel Times, it might substitute 10-pixel something else serif-ish, and that face has different line height characteristics than Times.  I don&#8217;t know what that other face might be, since it&#8217;s not Times New Roman or Georgia, but this is one possibility.  It is <strong>not</strong> the minimum font size setting in the preferences, as I&#8217;ve triple-checked to make sure I have that set to &#8220;None&#8221;.
</p>
</li>
<li>
<p>
Another possibility for Firefox&#8217;s line height weirdness is a shift from subpixel font rendering to pixelly font rendering.  10-pixel text in Firefox is distinctly pixelly compared to the other browsers I tested, while sizes above there are nice and smooth.  Why this would drive up the line height by two pixels (20%), though, is not clear to me.
</p>
</li>
<li>
<p>
Much of what I&#8217;ve observed will likely be laid to rest at the doorsteps of the font faces themselves.  I&#8217;d like to know how it is that the rounding behaviors are so (mathematically) messed up within faces, though.  Perhaps ideal line heights are described as an equation rather than a simple ratio?
</p>
</li>
</ol>

<p>
Again, this was all done in OS X; I&#8217;ll be very interested to find out what happens on Windows, Linux, and other operating systems.  Side note for the Mac Opera fans warming up their flamethrowers: I&#8217;ve left Opera 9.27 for OS X out of this because it seems to cap font sizes at a size well below 1000, although this limit varied from one face to another.  Webdings and Courier capped at 507 pixels, whereas Courier capped at 574 pixels and Comic Sans MS stopped at 707 pixels.  I have no explanation, though doubtless someone will, but the upshot is that direct comparisons between Opera and the other browsers are impossible.  For sizes up to 100 pixels, the results were exactly consistent with Camino, if that means anything.
</p>
<p>
The one tentative conclusion I did reach is this: <code>line-height: normal</code> is a jumbled terrain of inconsistent behaviors, and it&#8217;s best avoided in any sort of precision layout work.  I&#8217;d already had that feeling, but at least now there&#8217;s some evidence to back up the feeling.
</p>
<p>
In any case, I doubt this is the last I&#8217;ll have to say on this particular topic.
</p>
<p>
<strong>Update 7 May 08:</strong> I&#8217;ve updated <a href="http://meyerweb.com/eric/css/tests/line-height/inspect-multi.html">the test page</a> with <a href="http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-372941">a fix</a> from <a href="http://blowery.org/">Ben Lowery</a> so that it works in IE.  Thanks, Ben!  Now all I need is to add a way to type in any arbitrary font-family&#8217;s name, and we&#8217;ll have something everyone can use.  (Or else a way to use JavaScript to suck up the names of all the fonts installed on a machine and put them into the dropdown.  That would be cool, too.)
</p></div>

</div>

</div>
<p style="font-size: 90%; text-align: right; margin-top: 0.5em; padding-top: 0;">(If you care, there's even an <a href="/eric/thoughts/page/2/">archive of previous thoughts</a>...)</p>

</div><div id="extra"><div class="panel" id="archipelago"><h4>Identity Archipelago</h4><ul><li><a href="http://flickr.com/photos/meyerweb/" rel="me">Flickr</a></li><li><a href="http://twitter.com/meyerweb/" rel="me">Twitter</a></li><li><a href="http://dopplr.com/traveller/meyerweb">Dopplr</a></li><li><a href="http://www.linkedin.com/in/meyerweb" rel="me">LinkedIn</a></li><li><a href="http://technorati.com/profile/emeyer" rel="me">Technorati</a></li></ul></div><div class="panel" id="pointers"><h4>Projects Elsewhere</h4><ul><li><a href="http://aneventapart.com/">An Event Apart</a></li><li><a href="http://complexspiral.com/">Complex Spiral Consulting</a></li><li><a href="http://www.webassist.com/go/css/emeyer/">CSS Sculptor</a></li><li><a href="http://css-discuss.org/">css-discuss</a></li><li><a href="http://microformats.org/">Microformats</a></li><li><a href="http://s5project.org/">S5</a></li></ul></div><div class="panel" id="tour"><ul><li><a href="http://fray.com/issue3/"><img src="http://fray.com/images/i3c.gif" alt="Fray Contributor (Issue 3: Sex &amp; Death)" /></a></li><!-- <li><a href="http://www.webassist.com/go/css/emeyer/"><img src="/pix/CS_ad_180x109.jpg" alt="CSS Sculptor for Dreamweaver" style="max-width: 100%;" /></a></li> --></ul></div><div class="panel">
<h4>Recently Tweeted</h4>
<p class="more"><a href="http://twitter.com/meyerweb">see more</a></p>
<p>I think the fortune in my Chinese fortune cookie was written by Grover Norquist.  I bet he's getting paid for those off the books. <small>&#8211;tweeted 47 minutes ago</small></p>
</div><div id="sideblog" class="panel">
<h4>Distractions</h4>
<p class="more">
<a href="/eric/thoughts/recent-links/">archive</a>
</p>
<ul>
<li><a href="http://tweetagewasteland.com/2010/03/my-head-is-in-the-cloud/" title="March 18 | &#8220;I sense that my addiction to the realtime stream is only making room for the consumption of a faster stream.&#8221;">My Head is in the Cloud</a> <small>[via <a href="http://daringfireball.net/">John</a>]</small></li>
<li><a href="http://8bitnyc.com/" title="March 17 | All of a sudden I want to establish a mission in Central Park and negotiate with the natives for gold and food.">8-Bit NYC</a></li>
<li><a href="http://www.youtube.com/watch?v=nFicqklGuB0&amp;feature=player_embedded" title="March 12 | Wry comment expressing my appreciation of the creative derivativeness of this video and its uncanny accuracy in mocking common tropes.">Academy Award Winning Movie Trailer</a></li>
<li><a href="http://www.youtube.com/watch?v=414TmP12WAU" title="March 9 | &#8220;Apple juice&#8230; for half price!&#8221;  More like twice PRICELESS.  (Note: If you&#8217;re at work, don your headphones.)">Happy in Paraguay</a> <small>[via <a href="http://unstoppablerobotninja.com/">Ethan</a>]</small></li>
<li><a href="http://www.youtube.com/watch?v=9V5ubAOeOBk&amp;feature=player_embedded" title="February 10 | This is approximately the best thing ever.">U900 -Walk Don&#8217;t Run (Isogabamaware)</a></li>
<li><a href="http://www.456bereastreet.com/archive/201002/sifr_default_css_hides_content_from_at_least_one_screen_reader/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A 456bereastreet %28456 Berea Street%29" title="February 8 | -9999px comes through again, but I really wish we were beyond that kind of thing.">sIFR default CSS hides content from at least one screen reader</a></li>
<li><a href="http://www.macosxhints.com/article.php?story=20100117064356428" title="February 8 | Storing this for future use.">Take a picture with the iSight camera when a folder is opened</a></li>
<li><a href="http://mingle2.com/blog/view/web-developer-mind" title="February 4 | Mostly valid.  (SEE WHAT I DID THERE?)">The Mind of a Web Developer: An Illustrated Diagram</a></li>
<li><a href="http://www.theonion.com/content/news/science_channel_refuses_to_dumb" title="January 28 | &#8220;Punkin Chunkin, for Christ&#8217;s sake&#8230; What more do you people want?&#8221;">Science Channel Refuses To Dumb Down Science Any Further</a></li>
<li><a href="http://www.mailchimp.com/blog/project-omnivore-declassified/" title="January 27 | Sounds like quite a feat.  But I wonder how we&#8217;d feel if Microsoft or Google announced the same kind of thing on their e-mail services.">MailChimp&#8217;s Project Omnivore: Declassified</a></li>
<li><a href="http://www.politifact.com/truth-o-meter/statements/2010/jan/25/carolyn-maloney/congresswoman-says-democratic-presidents-create-mo/" title="January 26 | &#8220;Obviously, luck matters a lot, but when there is a consistent pattern over more than 60 years, it starts to look like more than just luck.&#8221;">Congresswoman says Democratic presidents create more private-sector jobs</a></li>
<li><a href="http://www.ted.com/talks/taylor_mali_what_teachers_make.html" title="January 25 | Truth.">Taylor Mali: What teachers make</a></li>
<li><a href="http://notebook.johnmartz.com/how-websites-work?c=1" title="January 22 | At last, the truth is out and I can stop pretending:  beatific monkeys are what makes it all go.">How websites work</a></li>
</ul>
</div>
<div class="panel" id="advisory">
<div class="guarded">
<a href="http://blogadvisorysystem.com/"><img src="/pix/bas/guarded.png" alt="Blog Advisory System Alert Level: Guarded"></a>
</div>
</div>

<div class="panel" id="excuse">
<h4>The <a href="/feeds/excuse/">excuse of the day</a> is</h4>
<p>Chrome</p>
</div>

<div class="panel" id="extras">
<h4>Extras</h4>
<ul>
<li><a href="/feeds/">Feeds</a> &#8226;</li>
<li><a href="/eric/faq.html">FAQ</a> &#8226;</li>
<li><a href="/family.html">Family</a></li>
</ul>
</div>

</div>

<div id="navigate">
<h4>Navigation</h4>
<ul id="navlinks">
<li id="archLink"><a href="/eric/thoughts/">Archives</a></li>
<li id="cssLink"><a href="/eric/css/">CSS</a></li>
<li id="toolsLink"><a href="/eric/tools/">Toolbox</a></li>
<li id="writeLink"><a href="/eric/writing.html">Writing</a></li>
<li id="speakLink"><a href="/eric/talks/">Speaking</a></li>
<li id="otherLink"><a href="/other/">Leftovers</a></li>
<li id="aboutsite"><a href="/ui/about.html">About this site</a></li>
</ul>
</div>

<div id="footer">
<p class="sosumi">All contents of this site, unless otherwise noted, are &copy;1995-2008 <strong>Eric A. and Kathryn S. Meyer</strong>.  All Rights Reserved.</p>
<p>"<a href="/eric/thoughts/">Thoughts From Eric</a>" is powered by the &uuml;bercool <a href="http://wordpress.org/">WordPress</a></p>
</div>
</body>
</html>
