<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://blog.pabloprieto.net/index.php/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
  <title>Pablo Prieto - Blog - line-height</title>
  <link>http://blog.pabloprieto.net/index.php/</link>
  <description>&quot;Faire des sites web c'est pas facile tous les jours&quot;</description>
  <language>fr</language>
  <pubDate>Fri, 19 Mar 2010 06:31:23 +0100</pubDate>
  <copyright></copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Pourquoi ai-je un rendu différent entre Firefox Windows et Firefox Mac ?</title>
    <link>http://blog.pabloprieto.net/index.php/post/2007/06/13/Pourquoi-ai-je-un-rendu-different-entre-Firefox-Windows-et-Firefox-Mac</link>
    <guid isPermaLink="false">urn:md5:8eacda8d7fb3b36472a44ec0a385785d</guid>
    <pubDate>Wed, 13 Jun 2007 14:18:00 +0200</pubDate>
    <dc:creator>Pab.</dc:creator>
        <category>Conception HTML et CSS</category>
        <category>css</category><category>firefox</category><category>line-height</category><category>mac</category><category>windows</category>    
    <description>&lt;p&gt;Vous l'avez peut-être déjà constaté, il arrive parfois que le rendu d'une page soit différent entre Firefox sous Windows et son homologue sous Mac. Certains en concluent un peu trop vite à un bug du moteur gecko ou encore que celui-ci serait différent entre les 2 plates-formes. Heureusement il n'en est rien, il s'agit bel et bien du même moteur. Alors d'ou vient cette différence&amp;nbsp;?&lt;/p&gt;    &lt;p&gt;Voici un exemple extrêmement simple, un paragraphe de texte de 300 pixels de large&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Strict//EN&amp;quot;
	&amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&amp;quot;&amp;gt;
&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; xml:lang=&amp;quot;fr&amp;quot; lang=&amp;quot;fr&amp;quot;&amp;gt;
&amp;lt;head&amp;gt;
	&amp;lt;meta http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=utf-8&amp;quot;/&amp;gt;
	&amp;lt;title&amp;gt;untitled&amp;lt;/title&amp;gt;	
	&amp;lt;style type=&amp;quot;text/css&amp;quot; media=&amp;quot;screen&amp;quot;&amp;gt;
		p{width:300px; background:#EEE;}
	&amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;	
	&amp;lt;p&amp;gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, (...) anim id est laborum.&amp;lt;/p&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;


&lt;p&gt;Et voici ce que l'on obtient sous Firefox Mac (à gauche) et Firefox Windows (à droite)&amp;nbsp;:&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://blog.pabloprieto.net/public/firefox_lineheight_1.png&quot; alt=&quot;firefox_lineheight_1.png&quot; /&gt;&lt;/p&gt;


&lt;p&gt;On le voit bien ici, &lt;strong&gt;la différence vient tout simplement d'une hauteur de ligne différente&lt;/strong&gt;. On n'y pense jamais assez, mais la propriété line-height est fixée par défaut à &quot;normal&quot; lorsque le concepteur ne la précise pas, laissant alors libre le navigateur de calculer une valeur &quot;raisonnable&quot; pour celle-ci. Cette valeur varie selon les systèmes d'exploitation, en fonction notamment de la résolution logique.&lt;/p&gt;


&lt;p&gt;Voici l'extrait de la &lt;a href=&quot;http://www.w3.org/TR/REC-CSS2/visudet.html#line-height&quot; hreflang=&quot;en&quot;&gt;norme CSS 2&lt;/a&gt; concernant la valeur &quot;normal&quot;&amp;nbsp;:&lt;/p&gt;


&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;normal&lt;/strong&gt;&lt;br /&gt;
Tells user agents to set the computed value to a &quot;reasonable&quot; value based on the font size of the element. The value has the same meaning as &amp;lt;number&amp;gt;. We recommend a computed value for 'normal' between 1.0 to 1.2.&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;Voici maintenant la même page avec une hauteur de ligne fixée à 1.2&amp;nbsp;:&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://blog.pabloprieto.net/public/firefox_lineheight_2.png&quot; alt=&quot;firefox_lineheight_2.png&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Le rendu est maintenant uniforme sur l'ensemble des navigateurs, et conforme au résultat attendu.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;Conclusion&amp;nbsp;: pensez à fixer vos hauteurs de ligne !&lt;/strong&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.pabloprieto.net/index.php/post/2007/06/13/Pourquoi-ai-je-un-rendu-different-entre-Firefox-Windows-et-Firefox-Mac#comment-form</comments>
      <wfw:comment>http://blog.pabloprieto.net/index.php/post/2007/06/13/Pourquoi-ai-je-un-rendu-different-entre-Firefox-Windows-et-Firefox-Mac#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.pabloprieto.net/index.php/feed/rss2/comments/25</wfw:commentRss>
      </item>
    
</channel>
</rss>