<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Darklg Blog &#187; css</title>
	<atom:link href="http://darklg.me/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://darklg.me</link>
	<description>Intégration, développement web, WordPress, SEO, Productivité &#38; caféine</description>
	<lastBuildDate>Mon, 20 May 2013 21:08:42 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Adieu CSS Normalize !</title>
		<link>http://darklg.me/2013/03/adieu-css-normalize/</link>
		<comments>http://darklg.me/2013/03/adieu-css-normalize/#comments</comments>
		<pubDate>Fri, 29 Mar 2013 22:43:56 +0000</pubDate>
		<dc:creator>Darklg</dc:creator>
				<category><![CDATA[Intégration HTML / CSS]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[cssnormalize]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>

		<guid isPermaLink="false">http://darklg.me/?p=1348</guid>
		<description><![CDATA[Et bienvenue à CSS Common ! Petite note de service pour annoncer que je change le nom de mon framework CSS Normalize en CSS Common.]]></description>
				<content:encoded><![CDATA[<p>Et bienvenue à <a href="http://lab.darklg.me/CSSCommon/" target="_blank"><strong>CSS Common</strong></a> ! Petite note de service pour annoncer que je change le nom de mon framework <strong>CSS Normalize</strong> en <strong>CSS Common</strong>.</p>
<p>On ne le dira jamais assez, bien choisir un nom est une étape à ne pas sauter. En l&rsquo;occurrence, j&rsquo;avais pris un nom trop proche de l&rsquo;excellent <a href="http://necolas.github.com/normalize.css/" target="_blank">normalize.css</a>, projet bien différent. </p>
<p>J&rsquo;en ai profité également pour unifier un peu les noms de classes CSS, en les préfixant de manière plus logique : <code>.cssc-*</code></p>
<p>Si vous aviez déjà cloné le projet, je vous invite à en refaire une copie :</p>
<pre>git clone git://github.com/Darklg/CSSCommon.git</pre>
<p><strong>PS :</strong> J&rsquo;essaie de faire le plus <a href="https://github.com/Darklg#contributions-calendar" target="_blank">long streak possible sur Github</a>, c&rsquo;est tout sauf évident !</p>
]]></content:encoded>
			<wfw:commentRss>http://darklg.me/2013/03/adieu-css-normalize/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Maintenables &#8211; Kaelig Deloumeau-Prigent</title>
		<link>http://darklg.me/2012/12/css-maintenables-kaelig-deloumeau-prigent/</link>
		<comments>http://darklg.me/2012/12/css-maintenables-kaelig-deloumeau-prigent/#comments</comments>
		<pubDate>Fri, 28 Dec 2012 18:27:25 +0000</pubDate>
		<dc:creator>Darklg</dc:creator>
				<category><![CDATA[Intégration HTML / CSS]]></category>
		<category><![CDATA[Lectures]]></category>
		<category><![CDATA[compass]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[livre]]></category>
		<category><![CDATA[maintenable]]></category>
		<category><![CDATA[methodologie]]></category>
		<category><![CDATA[sass]]></category>

		<guid isPermaLink="false">http://darklg.me/?p=840</guid>
		<description><![CDATA[CSS maintenables avec SASS &#038; Compass est un livre de Kaelig Deloumeau-Prigent, dont le blog Le ministère de l’intégration est une mine d’or pour tous les intégrateurs.]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.amazon.fr/gp/product/2212134177?ie=UTF8&#038;tag=darblo08-21&#038;linkCode=shr&#038;camp=3210&#038;creative=21458&#038;creativeASIN=2212134177&#038;qid=1356718833&#038;sr=8-1" title="Un vilain lien sponsorisé pour acheter le livre sur Amazon, désolé :(" target="_blank"><img src="http://darklg.me/wp-content/uploads/2012/08/css-maintenables-150x150.jpg" alt="CSS maintenables avec SASS &#038; Compass" width="150" height="150" style="float:right;margin:0 0 5px 5px;" /></a><strong>CSS maintenables avec SASS &#038; Compass</strong> est un livre de <em>Kaelig Deloumeau-Prigent</em>, dont le blog <a target="_blank" href="http://blog.kaelig.fr/">Le ministère de l&rsquo;intégration</a> est une mine d&rsquo;or pour tous les intégrateurs. </p>
<p>Le titre pourrait laisser penser que seuls SASS &#038; Compass sont abordés, mais ce livre parle majoritairement d&rsquo;organisation des CSS, ainsi que de bonnes pratiques pour produire des <strong>feuilles de styles maintenables, optimisées et réutilisables</strong>.</p>
<p>Il s&rsquo;agit d&rsquo;un sujet qui me tient à coeur, et c&rsquo;est avec grand plaisir que j&rsquo;ai lu ce livre qui aborde tous les pièges à éviter (et les bonnes pratiques à suivre) pour maintenir du CSS sur tout projet web. Ce livre est, selon moi, l&rsquo;une des <strong>lectures indispensables</strong> pour tout intégrateur qui se respecte. Il contient une <strong>méthodologie solide</strong> de maintenance des CSS, ainsi qu&rsquo;un tour d&rsquo;horizon des outils améliorant la qualité de votre code. </p>
<p>Si vous n&rsquo;êtes toujours pas convaincus, dites-vous que ce livre m&rsquo;a même donné envie de passer à SASS. Et oui.</p>
<h3>Sommaire</h3>
<ul>
<li>De &lt;font&gt; à @font-face : une problématique nouvelle</li>
<li>Première plongée dans CSS</li>
<li>Bonnes pratiques pour un code CSS lisible et maintenable</li>
<li>Pragmatisme : démystifier certaines bonnes pratiques</li>
<li>Les frameworks CSS</li>
<li>Travailler en équipe</li>
<li>Préprocesseurs CSS : quand la machine écrit pour vous</li>
<li>SASS et Compass</li>
<li>Erreurs de conception : comment les débusquer</li>
<li>Méthode : coder un design de zéro</li>
<li>Méthode : faire le ménage dans les CSS</li>
</ul>
<h3>Je le veux !</h3>
<p><strong>CSS maintenables</strong> est disponible sur <a href="http://www.amazon.fr/gp/product/2212134177?ie=UTF8&#038;tag=darblo08-21&#038;linkCode=shr&#038;camp=3210&#038;creative=21458&#038;creativeASIN=2212134177&#038;qid=1356718833&#038;sr=8-1" title="Un vilain lien sponsorisé pour acheter le livre sur Amazon, désolé :(" target="_blank">Amazon</a> ainsi que sur le <a href="http://www.eyrolles.com/Informatique/Livre/css-maintenables-9782212134179" target="_blank">site d&rsquo;Eyrolles</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://darklg.me/2012/12/css-maintenables-kaelig-deloumeau-prigent/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Centrage vertical en CSS sur un bloc à hauteur variable</title>
		<link>http://darklg.me/2012/07/centrage-vertical-en-css-sur-un-bloc-a-hauteur-variable/</link>
		<comments>http://darklg.me/2012/07/centrage-vertical-en-css-sur-un-bloc-a-hauteur-variable/#comments</comments>
		<pubDate>Fri, 13 Jul 2012 21:19:32 +0000</pubDate>
		<dc:creator>Darklg</dc:creator>
				<category><![CDATA[Intégration HTML / CSS]]></category>
		<category><![CDATA[astuce]]></category>
		<category><![CDATA[centrage]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://darklg.me/?p=825</guid>
		<description><![CDATA[Vous avez déjà eu besoin de centrer du texte verticalement dans un bloc dont vous ne connaissez pas la hauteur ? Voici une solution qui devrait vous convenir.]]></description>
				<content:encoded><![CDATA[<p>Vous avez déjà eu besoin de centrer du texte verticalement dans un bloc dont la hauteur varie ?<br />
Voici une solution qui devrait vous convenir.</p>
<p><strong>TL;DR</strong> : Voici le <a target="_blank" href="http://jsfiddle.net/vxBff/5/">JSFiddle de l&rsquo;exemple</a> de cet article.</p>
<p>Voici les éléments avec lesquels on va travailler : </p>
<ul>
<li>un bloc à hauteur variable : .bloc-hauteur-variable</li>
<li>un bloc à centrer verticalement : .bloc-a-centrer</li>
<li>un bloc wrapper autour du bloc à <strong>centrer verticalement</strong> : .bloc-wrapper</li>
</ul>
<p>Ce qui nous donne en HTML :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;bloc-hauteur-variable&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;bloc-wrapper&quot;</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;bloc-a-centrer&quot;</span>&gt;</span>
            Mon texte sur une deux, plusieurs lignes, une image, un tableau, que sais-je.
        <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p>Pour commencer, .bloc-hauteur-variable doit être <strong>en position relative</strong>, ensuite, on met en place une partie de <a href="http://www.alsacreations.com/tuto/lire/1032-comment-centrer-verticalement-sur-tous-les-navigateurs.html#cv_bloc">l&rsquo;astuce d&rsquo;Alsacréations</a> sur le centrage vertical :</p>
<p><em>Subtilité : assurez-vous que la hauteur de .bloc-wrapper soit plus grande que le contenu que vous souhaitez centrer. (Ici, j&rsquo;ai pris 400px)</em></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.bloc-hauteur-variable</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.bloc-wrapper</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">400px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">400px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.bloc-a-centrer</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">1.2</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-block<span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">vertical-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">middle</span><span style="color: #00AA00;">;</span>
    <span style="color: #808080; font-style: italic;">/* Coucou IE */</span>
    <span style="color: #00AA00;">*</span><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">inline</span><span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">*</span>zoom<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Enfin, on met en place un alignement vertical en positionnant .bloc-wrapper à 50% du haut de son parent. On rajoute une marge négative égale à la moitié de la hauteur <strong>(permise par le positionnement)</strong> afin de parfaitement centrer le tout.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.bloc-hauteur-variable</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #808080; font-style: italic;">/* Hauteur Arbitraire */</span>
    <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">632px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.bloc-wrapper</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">50%</span><span style="color: #00AA00;">;</span>
    <span style="color: #808080; font-style: italic;">/* margin-top = -(height/2) */</span>
    <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">-200px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">400px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">400px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.bloc-a-centrer</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">1.2</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-block<span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">vertical-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">middle</span><span style="color: #00AA00;">;</span>
    <span style="color: #808080; font-style: italic;">/* Coucou IE */</span>
    <span style="color: #00AA00;">*</span><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">inline</span><span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">*</span>zoom<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h3>En conclusion</h3>
<p>Cette technique tient un peu du <strong>bazooka</strong>, car elle combine <strong>deux techniques</strong> d&rsquo;alignement vertical : On centre verticalement un bloc dont on connait la hauteur moyenne, dans lequel on centre un bloc dont la hauteur est inconnue.</p>
<p>Cela fonctionne sur la <strong>majorité des navigateurs</strong>, dont IE8 &#038; 9 (Le contenu ne sera pas centré sur IE 7). Les cas d&rsquo;utilisation sont peu communs, mais on peut citer par exemple un <strong>site &laquo;&nbsp;full-screen&nbsp;&raquo;</strong>, ou un menu centré dans une sidebar fixe.</p>
]]></content:encoded>
			<wfw:commentRss>http://darklg.me/2012/07/centrage-vertical-en-css-sur-un-bloc-a-hauteur-variable/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Font-face avec Anti-Aliasing sur Mac OSX &amp; Windows.</title>
		<link>http://darklg.me/2012/03/font-face-avec-anti-aliasing-windows/</link>
		<comments>http://darklg.me/2012/03/font-face-avec-anti-aliasing-windows/#comments</comments>
		<pubDate>Mon, 19 Mar 2012 17:32:26 +0000</pubDate>
		<dc:creator>Darklg</dc:creator>
				<category><![CDATA[Intégration HTML / CSS]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[font-face]]></category>
		<category><![CDATA[typo]]></category>

		<guid isPermaLink="false">http://darklg.me/?p=654</guid>
		<description><![CDATA[Voici quelques pistes pour « lisser » un texte sous différents navigateurs sur Windows &#038; Mac OSX, ou du moins pour déclencher cleartype sur les typos, afin que votre font-face soit toujours beau et délicat :
]]></description>
				<content:encoded><![CDATA[<p>Voici quelques pistes pour <strong>&laquo;&nbsp;lisser&nbsp;&raquo; un texte</strong> sous différents navigateurs sur <strong>Windows</strong> et <strong>Mac OSX</strong>, ou du moins pour <strong>déclencher cleartype</strong> sur les typos, afin que votre font-face soit toujours beau et délicat : </p>
<h3>Sur IE 7 &amp; IE 8</h3>
<p>Une opacité de .99 semble déclencher le lissage de la police.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;">filter<span style="color: #00AA00;">:</span> alpha<span style="color: #00AA00;">&#40;</span>opacity<span style="color: #00AA00;">=</span><span style="color: #cc66cc;">99</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span></pre></td></tr></table></div>

<p>Un background non transparent défini sur le bloc ou son parent marche parfois également.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span></pre></td></tr></table></div>

<h3>Sur Webkit (Google Chrome, Safari, &#8230;)</h3>
<p>L&rsquo;opacité à 999‰ peut également ramener un rendu de police correct &#8230; <strong>même sous OSX</strong>. Cette astuce permettra également d&rsquo;éviter l&rsquo;effet de police qui devient grasse lorsqu&rsquo;on change son opacité avec transition.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;">opacity<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0.999</span><span style="color: #00AA00;">;</span></pre></td></tr></table></div>

<p>Changer l&rsquo;ordre des types de font (parfois remonter le SVG) dans la propriété font-face m&rsquo;a donné de belles surprises, sous Windows &#038; OSX.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@font-face {</span>
    <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">'MaFont'</span><span style="color: #00AA00;">;</span>
    src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'MaFont.eot'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
    src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'MaFont.eot?#iefix'</span><span style="color: #00AA00;">&#41;</span> format<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'embedded-opentype'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span>
         <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'MaFont.svg#MaFont'</span><span style="color: #00AA00;">&#41;</span> format<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'svg'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span>
         <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'MaFont.woff'</span><span style="color: #00AA00;">&#41;</span> format<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'woff'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span>
         <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'MaFont.ttf'</span><span style="color: #00AA00;">&#41;</span> format<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'truetype'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">font-style</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>webkit-text-stroke ajoute une bordure interne (couleur/taille à adapter) et permet de &laquo;&nbsp;récupérer&nbsp;&raquo; certaines polices fines.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;">-webkit-text-stroke<span style="color: #00AA00;">:</span> <span style="color: #933;">0.5px</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span></pre></td></tr></table></div>

<p>Une très légère rotation peut éventuellement activer ClearType.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;">-webkit-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>-0.0000000001deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span></pre></td></tr></table></div>

<p>Sur les anciennes version de Chrome, une ombre presque invisible déclenchait Cleartype. Ne fonctionne plus sur les dernières versions.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">1px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0.01</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span></pre></td></tr></table></div>

<p>Jouer avec <strong>webkit-font-smoothing</strong> peut aussi donner un résultat.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;">-webkit-font-smoothing<span style="color: #00AA00;">:</span> <span style="color: #00AA00;">&#40;</span>subpixel-antialiased|antialiased|<span style="color: #993333;">none</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span></pre></td></tr></table></div>

<h3>Sur Firefox</h3>
<p>Un fichier .htaccess contenant le mime-type des polices devrait être présent.</p>
<pre>AddType font/ttf .ttf
AddType font/eot .eot
AddType font/otf .otf
AddType font/woff .woff</pre>
<p>&nbsp;</p>
<h3>Sur les autres navigateurs &#8230; </h3>
<ul>
<li>Si vous utilisez le <a rel="external" href="http://www.fontsquirrel.com/fontface/generator">Font-Face Generator de Font Squirrel</a>, assurez vous (mode expert) d&rsquo;utiliser <strong>&laquo;&nbsp;Truetype Hinting: Font Squirrel&nbsp;&raquo;</strong>. Si vous n&rsquo;êtes pas sûr et que votre rendu n&rsquo;est pas génial, renvoyez le fichier original !</li>
<li>Assurez-vous que le font-weight déclaré en CSS correspond au <strong>font-weight</strong> de la police chargée.</li>
<li>Parfois, les navigateurs <strong>préfèreront une taille de police</strong> à une autre. 12px ou 16px peuvent, par exemple, donner de meilleurs résultats que 13px ou 17px.</li>
<li>Jouer avec <strong>text-shadow</strong> peut aider légèrement sur Firefox.</li>
<li>Si rien ne marche, votre typo n&rsquo;est probablement pas adaptée à un usage web. Il est difficile d&rsquo;imiter certains réglages de Photoshop, comme &laquo;&nbsp;Police Nette&nbsp;&raquo; et autres.</li>
</ul>
<p>Et vous, vous avez d&rsquo;autres pistes ?</p>
]]></content:encoded>
			<wfw:commentRss>http://darklg.me/2012/03/font-face-avec-anti-aliasing-windows/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Remplacement de texte par une image en CSS</title>
		<link>http://darklg.me/2012/03/remplacement-texte-par-image-css/</link>
		<comments>http://darklg.me/2012/03/remplacement-texte-par-image-css/#comments</comments>
		<pubDate>Thu, 15 Mar 2012 08:50:36 +0000</pubDate>
		<dc:creator>Darklg</dc:creator>
				<category><![CDATA[Intégration HTML / CSS]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[remplacement]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://darklg.me/?p=698</guid>
		<description><![CDATA[Ayant vu de nombreuses techniques pour remplacer un texte par une image en CSS, je me permets de partager la mienne, qui ne m'a jamais fait défaut, avec les explications adéquates.]]></description>
				<content:encoded><![CDATA[<p>Ayant vu de <a href="http://css-tricks.com/examples/ImageReplacement/" lang="en" rel="external">nombreuses techniques</a> pour remplacer un texte par une image en CSS, je me permets de partager la mienne, qui ne m&rsquo;a jamais fait défaut, avec les explications adéquates.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h3</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;irh3&quot;</span>&gt;</span>Mon texte alternatif<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h3</span>&gt;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.irh3</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span> <span style="color: #00AA00;">:</span> inline-block<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span> <span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span> <span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">overflow</span> <span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-align</span> <span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-indent</span> <span style="color: #00AA00;">:</span> <span style="color: #933;">-9999px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">white-space</span> <span style="color: #00AA00;">:</span> <span style="color: #993333;">nowrap</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span> <span style="color: #00AA00;">:</span> <span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span>http<span style="color: #00AA00;">:</span>//lorempixel.com/<span style="color: #cc66cc;">100</span>/<span style="color: #cc66cc;">50</span>/<span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h3>Exemple : </h3>
<p><span style="display:inline-block;width:100px;height:30px;overflow:hidden;text-align:left;text-indent:-9999px;background:transparent url(http://lorempixel.com/100/50/) no-repeat top left">Mon texte alternatif</span></p>
<h3>Explications : </h3>
<ul>
<li>On commence par définir un <strong>type inline-block</strong> sur l&rsquo;élément. Le display:block fonctionne aussi, mais j&rsquo;ai plus souvent besoin du display:inline-block;.</li>
<li>On lui donne la <strong>taille de l&rsquo;image</strong> interne, qu&rsquo;on dispose en <strong>background</strong>.</li>
<li>Le <strong>text-indent</strong> va décaler le texte loin sur la gauche (ce dont on s&rsquo;assure avec le <strong>text-align:left;</strong>), le <strong>white-space:nowrap;</strong> s&rsquo;assurant qu&rsquo;il soit sans retour à la ligne.</li>
<li>Le <strong>overflow:hidden</strong> évite que le texte soit éventuellement visible sur la gauche, s&rsquo;il est trop long.</li>
</ul>
<p>Je suis conscient que cette technique est assez lourde, mais elle a l&rsquo;avantage de ne jamais m&rsquo;avoir lâché : )</p>
]]></content:encoded>
			<wfw:commentRss>http://darklg.me/2012/03/remplacement-texte-par-image-css/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>[Snippet] Bordures multiples en CSS3</title>
		<link>http://darklg.me/2012/03/snippet-bordures-multiples-en-css3/</link>
		<comments>http://darklg.me/2012/03/snippet-bordures-multiples-en-css3/#comments</comments>
		<pubDate>Mon, 05 Mar 2012 17:01:35 +0000</pubDate>
		<dc:creator>Darklg</dc:creator>
				<category><![CDATA[Intégration HTML / CSS]]></category>
		<category><![CDATA[border]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>

		<guid isPermaLink="false">http://darklg.me/?p=689</guid>
		<description><![CDATA[Vous avez peut-être déjà eu besoin de faire plusieurs bordures de couleurs différentes sur un seul bloc. Avec CSS3, c'est désormais jouable !]]></description>
				<content:encoded><![CDATA[<p>Vous avez peut-être déjà eu besoin de faire plusieurs bordures de couleurs différentes sur un seul bloc. Avec CSS3, c&rsquo;est désormais jouable !</p>
<p>La technique la plus connue en CSS2, malgré sa limite à deux bordures, était :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.monbloc</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span> <span style="color: #993333;">solid</span> <span style="color: #000000; font-weight: bold;">blue</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<div style="margin:10px;width:20px;height:20px;border:2px solid blue;outline:2px solid red;"></div>
<p>Heureusement, CSS3, avec son box-shadow, apporte une solution toute simple pour augmenter le nombre de bordures : Appliquer des ombres multiples, avec une diffusion de 0px et une épaisseur choisie.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.monbloc</span> <span style="color: #00AA00;">&#123;</span>
-webkit-box-shadow<span style="color: #00AA00;">:</span>  <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">2px</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">4px</span> <span style="color: #000000; font-weight: bold;">blue</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">6px</span> <span style="color: #993333;">green</span><span style="color: #00AA00;">;</span>
-moz-box-shadow<span style="color: #00AA00;">:</span>  <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">2px</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">4px</span> <span style="color: #000000; font-weight: bold;">blue</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">6px</span> <span style="color: #993333;">green</span><span style="color: #00AA00;">;</span>
box-shadow<span style="color: #00AA00;">:</span>  <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">2px</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">4px</span> <span style="color: #000000; font-weight: bold;">blue</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">6px</span> <span style="color: #993333;">green</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<div style="margin:10px;width:20px;height:20px;-webkit-box-shadow:0 0 0 2px red,0 0 0 4px blue,0 0 0 6px green;-moz-box-shadow:0 0 0 2px red,0 0 0 4px blue,0 0 0 6px green;box-shadow:0 0 0 2px red,0 0 0 4px blue,0 0 0 6px green;"></div>
<p>La taille de chaque ombre est égale à celle de la bordure voulue, plus celle de l&rsquo;ombre précédente.</p>
<p>Attention, deux inconvénients à cette technique :</p>
<ul>
<li>elle n&rsquo;est compatible qu&rsquo;à partir d&rsquo;IE9 (Donc à destination de 70% du public, selon <a href="http://caniuse.com/css-boxshadow">CAN I USE</a>)</li>
<li>Les ombres ne sont pas gérées dans le <a href="https://developer.mozilla.org/En/CSS/Box-sizing">box-sizing</a> de l&rsquo;élément</li>
</ul>
<p>Vous connaissez une meilleure technique (sans image?)</p>
]]></content:encoded>
			<wfw:commentRss>http://darklg.me/2012/03/snippet-bordures-multiples-en-css3/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Débug rapide d&#8217;Internet Explorer 7 sur Mac</title>
		<link>http://darklg.me/2011/10/debug-rapide-internet-explorer-7-sur-mac/</link>
		<comments>http://darklg.me/2011/10/debug-rapide-internet-explorer-7-sur-mac/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 09:21:30 +0000</pubDate>
		<dc:creator>Darklg</dc:creator>
				<category><![CDATA[Intégration HTML / CSS]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[internet explorer]]></category>

		<guid isPermaLink="false">http://darklg.me/?p=664</guid>
		<description><![CDATA[Plus une astuce qu’un véritable article, mais je viens de tester l’application WineBottler, qui permet, à l’aide de Wine, d’installer une version d’Internet Explorer 7 sur Mac.]]></description>
				<content:encoded><![CDATA[<p>Plus une astuce qu&rsquo;un véritable article, mais je viens de tester l&rsquo;application <a href="http://winebottler.kronenberg.org">WineBottler</a>, qui permet, à l&rsquo;aide de Wine, d&rsquo;installer une version d&rsquo;<strong>Internet Explorer 7 sur Mac</strong>. <del>Certains vont me dire : MER IL ET FOU.</del>*</p>
<p>J&rsquo;ai donc suivi un <a href="http://xsolutions.free.fr/home/mac/soft/IEsurMac.php" title="Attention les yeux, Tutoriel sur IE7">tutoriel d&rsquo;installation</a>, pour arriver à un fichier <em>Microsoft Internet Explorer 7.app</em> dans mon dossier d&rsquo;Applications.</p>
<p>Le résultat est à la hauteur de mes attentes. L&rsquo;interface est buguée, le JS semble difficilement géré, les polices laissées au soin du navigateur ( font-family:serif; et autres sans-serif ) sont hasardeuses, et il semble ignorer les <a href="http://darklg.me/2011/08/internet-explorer-body-css-class/" title="Snippet : Internet Explorer en Body CSS Class">conditions HTML &#038; body multiples</a>.</p>
<p>Malgré ça, il se lance en une poignée de secondes, est donc bien plus rapide qu&rsquo;une machine virtuelle, et vous permettra de lancer ponctuellement <strong>Internet Explorer sur votre Mac</strong> en début de projet, plutôt que de devoir faire des &laquo;&nbsp;pauses machine virtuelle&nbsp;&raquo; pour vérifier les bugs éventuels de vos intégrations.</p>
<p>Une arme à double tranchant, mais tout de même une astuce à partager ; )</p>
<p><img src="http://darklg.me/wp-content/uploads/2011/10/darklg-internet-explorer-mac-500x395.png" alt="darklg blog dans internet explorer ma" title="darklg blog dans internet explorer mac" width="500" height="395" /></p>
<p>* <a href="http://www.gamekult.com/forum/topic-dois-je-acheter-la-psp-550218n.html">Grosse référence</a></p>
]]></content:encoded>
			<wfw:commentRss>http://darklg.me/2011/10/debug-rapide-internet-explorer-7-sur-mac/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Réorganisez vos propriétés CSS avec CSSLisible</title>
		<link>http://darklg.me/2011/08/reorganisez-vos-proprietes-css-avec-csslisible/</link>
		<comments>http://darklg.me/2011/08/reorganisez-vos-proprietes-css-avec-csslisible/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 21:12:53 +0000</pubDate>
		<dc:creator>Darklg</dc:creator>
				<category><![CDATA[Développement PHP / MySQL]]></category>
		<category><![CDATA[Intégration HTML / CSS]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[propriétés]]></category>

		<guid isPermaLink="false">http://darklg.me/?p=652</guid>
		<description><![CDATA[Voici CSSLisible, un simple script en PHP pour réorganiser vos CSS, disponible sur GitHub. ]]></description>
				<content:encoded><![CDATA[<p>Je vous en ai parlé il y a peu, <a href="http://darklg.me/?p=458">CSS Avancées</a> est un livre fantastique. Dans les premiers chapitres (pages 53.54), l&#8217;auteur évoque une règle d&#8217;<strong>organisation des propriétés CSS</strong> dans un sélecteur qui m&#8217;a beaucoup marqué:</p>
<ul>
<li>Contenu créé : ( content, etc )</li>
<li>Propriété display</li>
<li>Positionnement ( z-index, position, top )</li>
<li>Modèle de boîte ( height, margin, border &#8230; )</li>
<li>Transformations et transitions</li>
<li>Typographie</li>
<li>Décoration</li>
</ul>
<p>L&#8217;ordre recommandé par l&#8217;auteur peut être adapté à ses goûts / à la méthode de son entreprise, mais l&#8217;essentiel reste là : regrouper les propriétés par type, afin de mieux <strong>relire son code</strong>, trouver directement un bug, et tous les avantages d&#8217;une convention de codage.</p>
<p>Ainsi, dans la lignée des petits scripts qui font mouche, comme <a href="http://darklg.me/?p=647">img2datauri</a>, voici <a href="http://github.com/Darklg/CSSLisible">CSSLisible</a>, un simple script en PHP pour réorganiser vos CSS, <a href="http://github.com/Darklg/CSSLisible">disponible sur GitHub</a>.</p>
<p>Le principe est simple, on <strong>télécharge</strong>, on <strong>fork</strong> ou on <strong>clone</strong> le code dans son dossier www ou htdocs de MAMP/LAMP/WAMP, et on y accède depuis son navigateur.</p>
<p>L&#8217;interface sobre, et sans CSS, ô ironie, vous permet de coller un bout de code à nettoyer, pour obtenir en retour un <strong>code réorganisé</strong>, et <strong>trié</strong> dans l&rsquo;ordre de priorité des priorités. Il s&rsquo;agit d&rsquo;une base de travail à faire évoluer, l&rsquo;algorithme de tri étant très primaire.</p>
<p>Testez directement <a href="http://lab.darklg.me/CSSLisible">CSSLisible</a></p>
<p>Je suis évidemment ouvert à tous retours <img src='http://darklg.me/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://darklg.me/2011/08/reorganisez-vos-proprietes-css-avec-csslisible/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Une image en CSS background-image avec data:uri : img2datauri</title>
		<link>http://darklg.me/2011/08/background-image-data-uri/</link>
		<comments>http://darklg.me/2011/08/background-image-data-uri/#comments</comments>
		<pubDate>Thu, 04 Aug 2011 10:31:36 +0000</pubDate>
		<dc:creator>Darklg</dc:creator>
				<category><![CDATA[Bout de code]]></category>
		<category><![CDATA[Intégration HTML / CSS]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[datauri]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[images]]></category>

		<guid isPermaLink="false">http://darklg.me/?p=647</guid>
		<description><![CDATA[Vous avez toujours rêvé de pouvoir convertir une image en data-uri, avec sortie direct du code CSS approprié ? C&#8217;est possible avec img2datauri, script disponible sur Github, réalisé par votre serviteur au sein de la société Colorz. Vous ne connaissez pas encore le principe du data:uri ? Direction Wikipedia Oui, ça existe déjà, mais c&#8217;est [...]]]></description>
				<content:encoded><![CDATA[<p>Vous avez toujours rêvé de pouvoir convertir une image en data-uri, avec sortie direct du code CSS approprié ? C&rsquo;est possible avec <a href="http://github.com/Darklg/img2datauri">img2datauri, script disponible sur Github</a>, réalisé par votre serviteur au sein de la société <a href="http://www.colorz.fr">Colorz</a>.</p>
<p>Vous ne connaissez pas encore le principe du data:uri ? <a href="http://en.wikipedia.org/wiki/Data_URI_scheme" lang="en">Direction Wikipedia</a></p>
<p>Oui, ça existe déjà, mais c&rsquo;est pour l&rsquo;exercice de style.</p>
]]></content:encoded>
			<wfw:commentRss>http://darklg.me/2011/08/background-image-data-uri/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Snippet : Internet Explorer en Body CSS Class</title>
		<link>http://darklg.me/2011/08/internet-explorer-body-css-class/</link>
		<comments>http://darklg.me/2011/08/internet-explorer-body-css-class/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 09:51:43 +0000</pubDate>
		<dc:creator>Darklg</dc:creator>
				<category><![CDATA[Bout de code]]></category>
		<category><![CDATA[Intégration HTML / CSS]]></category>
		<category><![CDATA[body]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[internet explorer]]></category>

		<guid isPermaLink="false">http://darklg.me/?p=645</guid>
		<description><![CDATA[Une technique assez connue, quand vos sites n'ont pas besoin d'une feuille de style, est de mettre une classe à HTML ou BODY pour indiquer la version d'IE, grâce aux commentaires conditionnels.]]></description>
				<content:encoded><![CDATA[<p>Une technique assez connue, quand vos sites n&rsquo;ont pas besoin d&rsquo;une feuille de style, est de mettre une classe à HTML ou BODY pour indiquer la version d&rsquo;IE, grâce aux commentaires conditionnels.<br />
Exemple dans <a href="https://github.com/paulirish/html5-boilerplate/blob/master/index.html">HTML Boilerplate</a> :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!--[if lt IE 7]&gt; &lt;html class=&quot;no-js ie6 oldie&quot; lang=&quot;en&quot;&gt; &lt;![endif]--&gt;</span>
<span style="color: #808080; font-style: italic;">&lt;!--[if IE 7]&gt;    &lt;html class=&quot;no-js ie7 oldie&quot; lang=&quot;en&quot;&gt; &lt;![endif]--&gt;</span>
<span style="color: #808080; font-style: italic;">&lt;!--[if IE 8]&gt;    &lt;html class=&quot;no-js ie8 oldie&quot; lang=&quot;en&quot;&gt; &lt;![endif]--&gt;</span>
<span style="color: #808080; font-style: italic;">&lt;!--[if gt IE 8]&gt;&lt;!--&gt;</span> <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;no-js&quot;</span> <span style="color: #000066;">lang</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;en&quot;</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!--&lt;![endif]--&gt;</span></pre></td></tr></table></div>

<p>Je vous propose ma version (dans body, mais vous avez le choix), permettant de cibler plus finement les versions :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!--[if lt IE 7 ]&gt;&lt;body class=&quot;maclass is_ie6 lt_ie7 lt_ie8 lt_ie9 lt_ie10&quot;&gt;&lt;![endif]--&gt;</span> 
<span style="color: #808080; font-style: italic;">&lt;!--[if IE 7 ]&gt;&lt;body class=&quot;maclass is_ie7 lt_ie8 lt_ie9 lt_ie10&quot;&gt;&lt;![endif]--&gt;</span> 
<span style="color: #808080; font-style: italic;">&lt;!--[if IE 8 ]&gt;&lt;body class=&quot;maclass is_ie8 lt_ie9 lt_ie10&quot;&gt;&lt;![endif]--&gt;</span> 
<span style="color: #808080; font-style: italic;">&lt;!--[if IE 9 ]&gt;&lt;body class=&quot;maclass is_ie9 lt_ie10&quot;&gt;&lt;![endif]--&gt;</span> 
<span style="color: #808080; font-style: italic;">&lt;!--[if gt IE 9]&gt;&lt;body class=&quot;maclass is_ie10&quot;&gt;&lt;![endif]--&gt;</span> 
<span style="color: #808080; font-style: italic;">&lt;!--[if !IE]&gt;&lt;!--&gt;</span> <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;maclass&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--&lt;![endif]--&gt;</span></pre></td></tr></table></div>

<p>Du coup, les débugs IE sont bien plus propres :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.monbloc</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">display</span><span style="color: #3333ff;">:inline-</span>block<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.lt_ie8</span> <span style="color: #6666ff;">.monbloc</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">inline</span><span style="color: #00AA00;">;</span>zoom<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">1</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://darklg.me/2011/08/internet-explorer-body-css-class/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
