<?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>The Bright Lines &#187; cross-browser</title>
	<atom:link href="http://www.thebrightlines.com/tag/cross-browser/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thebrightlines.com</link>
	<description>HTML, CSS, Javascript and more</description>
	<lastBuildDate>Thu, 29 Jul 2010 22:44:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Test: Popular professional fonts as webfont</title>
		<link>http://www.thebrightlines.com/2010/01/24/test-popular-professional-fonts-as-webfont/</link>
		<comments>http://www.thebrightlines.com/2010/01/24/test-popular-professional-fonts-as-webfont/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 23:04:43 +0000</pubDate>
		<dc:creator>Wouter Bos</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Webfonts]]></category>
		<category><![CDATA[cross-browser]]></category>
		<category><![CDATA[font-face]]></category>
		<category><![CDATA[fonts]]></category>

		<guid isPermaLink="false">http://www.thebrightlines.com/?p=390</guid>
		<description><![CDATA[How well do professional fonts render on the web? In this article you'll see a few examples and screenshots where the font rendering goes wrong.]]></description>
			<content:encoded><![CDATA[<h2>Why testing popular paid fonts?</h2>
<p>I wanted to know how fonts that are popular with designers would look like on the web. Can you just convert those fonts to a webfont and put it in your website? I had mixed experiences with free fonts. But hey, they&#8217;re free. Maybe the those fonts you paid a lot of money for <em>can</em> do the job.</p>
<p>When designers realize that web browsers can load any font, they will try to push the limits with trying new fonts and web developers will certainly be pressured to convert a Gill Sans or Garamond into a webfont. License or no license. Especially since they are able to create fonts that contain just a subset of the original characters. That makes it unfit for people who hope to get a professional font for free by just downloading the font file from a website.</p>
<h2>The test procedure</h2>
<p>Please don&#8217;t pin me on not having the right Helvetica or Garamond. I&#8217;m not familiar with the subtleties between different version and foundries. I converted the selected fonts with <a href="http://www.fontsquirrel.com/fontface/generator">Fontsquirrel&#8217;s fontface generator</a>. The result is viewed in the following browsers:</p>
<ul>
<li>Firefox 3.5.7 or 3.6 RC1 on Windows Vista</li>
<li>IE8 on Windows Vista</li>
<li>IE6 on Windows XP</li>
<li>Safari 3.12 on Mac OS X Leopard. Since I don&#8217;t own a Mac I used the service of <a href="http://www.browsrcamp.com/">Browsrcamp.com</a>.</li>
</ul>
<p>Fontsquirrel generates a preview text in different font sizes. I used that list of predefined font sizes as my check list. So I tested these font sizes:</p>
<p><strong>9 10 11 12 13 14 15 16 17 18 21 24 30 36 48 60 72</strong></p>
<p>As you see there are enough other font sizes that might work as webfont. This test is not intended to be absolute and complete. I want to see how professional fonts behave as webfonts and what the typical font render problems are in browsers.</p>
<h2>Helvetica</h2>
<p>Definitely an all-time favorite. Apple computers have a Helvetica installed by default, but Windows does not. The Helvetica that I used for this test renders reasonably. Check out the screenshots for <a href="/article-data/images/webfont-pop-helvetica-Firefox.png" target="_blank">Firefox</a>, <a href="/article-data/images/webfont-pop-helvetica-IE8.png">IE8</a>, <a href="/article-data/images/webfont-pop-helvetica-IE6.png">IE6</a> and <a href="/article-data/images/webfont-pop-helvetica-Safari.png">Safari</a>. I also have the screenshots of the <em>italic</em> fonts for <a href="/article-data/images/webfont-pop-helvetica-Firefox-italic.png" target="_blank">Firefox</a>, <a href="/article-data/images/webfont-pop-helvetica-IE8-italic.png">IE8</a>, <a href="/article-data/images/webfont-pop-helvetica-IE6-italic.png">IE6</a> and <a href="/article-data/images/webfont-pop-helvetica-Safari-italic.png">Safari</a>. There are enough rendering glitches, though:</p>
<div class="wp-caption alignnone" style="width: 412px"><img title="Some letters are combined in Firefox at font size 11px" src="/article-data/images/webfont-pop-helvetica1.png" alt="Some letters are combined in Firefox at font size 11px" width="402" height="52" /><p class="wp-caption-text">Some chracters are combined in Firefox (Windows Vista) at 11px.</p></div>
<div class="wp-caption alignnone" style="width: 376px"><img title="The kerning is of in IE8, Vista at 15px" src="/article-data/images/webfont-pop-helvetica2.png" alt="The kerning is of in IE8, Vista at 15px" width="366" height="52" /><p class="wp-caption-text">The kerning of the &#39;e&#39; is off in IE8, Vista at 15px.</p></div>
<div class="wp-caption alignnone" style="width: 376px"><img title="Some letters seem to have a cap at various font sizes in IE8 Vista" src="/article-data/images/webfont-pop-helvetica3.png" alt="Some letters seem to have a cap at various font sizes in IE8 Vista" width="366" height="52" /><p class="wp-caption-text">Some characters seem to have a cap at font sizes 14, 16 and 18px in IE8 Vista.</p></div>
<div class="wp-caption alignnone" style="width: 376px"><img title="Another kerning problem: the top is cut off in IE8 at smaller font sizes" src="/article-data/images/webfont-pop-helvetica4.png" alt="Another kerning problem: the top is cut off in IE8 at smaller font sizes" width="366" height="52" /><p class="wp-caption-text">Another kerning problem: the top is cut off in IE8 at smaller font sizes.</p></div>
<div class="wp-caption alignnone" style="width: 376px"><img title="IE6 on XP SP3 is doing OK except with vertical lines in smaller font sizes" src="/article-data/images/webfont-pop-helvetica5.png" alt="IE6 on XP SP3 is doing OK except with vertical lines in smaller font sizes" width="366" height="52" /><p class="wp-caption-text">IE6 on XP SP3 is doing better than IE8 Vista, but vertical lines are over-emphesized at smaller font sizes and the text is very grey.</p></div>
<p>Looking in all four browsers, we get this list of usable and unusable font sizes.<br />
<span style="color: #008000;"><span style="color: #ff0000;">9 10 11 12</span> <strong>13</strong> <span style="color: #ff0000;">14 15 16</span> <strong>17</strong> <span style="color: #ff0000;">18 21</span> <span style="color: #008000;"><strong>24 30 36 48 60 72</strong></span></span></p>
<h2>Garamond</h2>
<p>Screenshots of Garamond in <a href="/article-data/images/webfont-pop-garamond-Firefox.png" target="_blank">Firefox</a>, <a href="/article-data/images/webfont-pop-garamond-IE8.png">IE8</a>, <a href="/article-data/images/webfont-pop-garamond-IE6.png">IE6</a> and <a href="/article-data/images/webfont-pop-garamond-Safari.png">Safari</a>.</p>
<p>There were lots of Garamonds to choose from. Don&#8217;t pin me down on not having the right Garamond of the right vendor. The errors that I encountered here are of more importance than the difference between different Garamonds.</p>
<p>With Garamond we can clearly see the strange font rendering that can happen in Firefox It&#8217;s almost as if it tries to add some creative touch to the font and fails. Take a look at the images below. Some characters are very different from the original font design, not? These rendering oddities also occur with the type <a href="http://www.josbuivenga.demon.nl/fontinsans.html">Fontin Sans</a>, that&#8217;s used on this website. It means that I cannot use some font sizes because some characters look weird.</p>
<div class="wp-caption alignnone" style="width: 118px"><img title="Firefox PC: the letter q in different font sizes appear very different from each other" src="/article-data/images/webfont-pop-garamond-1.png" alt="Firefox PC: the letter q in different font sizes appear very different from each other" width="108" height="45" /><p class="wp-caption-text">Firefox PC: the character &#39;q&#39; in different font sizes appear very different from each other.</p></div>
<div class="wp-caption alignnone" style="width: 310px"><img title="Firefox PC at font size 13: note the odd g and the uneven distribution of space in the m" src="/article-data/images/webfont-pop-garamond-2.png" alt="Firefox PC at font size 13: note the odd g and the uneven distribution of space in the m" width="300" height="54" /><p class="wp-caption-text">Firefox PC at font size 13px: note the odd &#39;g&#39; and the uneven distribution of space in the &#39;m&#39;.</p></div>
<p>IE8 is even worse, Mostly because of bad kerning, I&#8217;d only use this font if the size is 48 pixels or larger. Look at the images below to see what IE8 does with text in large font sizes like 36px and 60px.</p>
<div class="wp-caption alignnone" style="width: 223px"><img title="Because of bad aliasing and bad kerning the e even looks bad at a font size of 36px!" src="/article-data/images/webfont-pop-garamond-3.png" alt="Because of bad aliasing and bad kerning the e even looks bad at a font size of 36px!" width="213" height="40" /><p class="wp-caption-text">IE8: Because of bad aliasing and bad kerning the &#39;e&#39; even looks bad at a font size of 36px!</p></div>
<div class="wp-caption alignnone" style="width: 132px"><img title="IE8 again: Although I think its more or less acceptable, the capital definitely needs more anti-aliasing." src="/article-data/images/webfont-pop-garamond-4.png" alt="IE8 again: Although I think its more or less acceptable, the capital definitely needs more anti-aliasing." width="122" height="62" /><p class="wp-caption-text">IE8 again: Although I think it&#39;s more or less acceptable, the capital &#39;T&#39; definitely needs more anti-aliasing at the top.</p></div>
<h3>Garamond file size</h3>
<p>My Garamond font file is very large to be a webfont by the way: 343Kb. That really asks for removing some characters. If I omit support for Greek, Coptic and Cyrillic, I can scale the file size back to 112 Kb. If I choose to only support Basic Latin, Latin-1 Sup, Currency  Symbols and Punctuation, I end up with a file size of 82 Kb. Then you&#8217;ll have just one font style of the font family. If you want to have text in Italic, you have to double the file size.</p>
<h3>Garamond font size</h3>
<p>If you want to use a Garamond, you&#8217;ll have to use a much larger font size. That&#8217;s because the height difference between uppercase and lowercase in a Garamond is larger than the standard Arial. You need a 16px Garamond to get lowercase text that is of equal to that of a 12px Arial. In case of Helvetica it&#8217;s 13px by the way.</p>
<p>So we get this list of usable and unusable font sizes:<strong><span style="color: #339966;"><br />
</span></strong><span style="color: #ff0000;">9 10 11</span><span style="color: #ff0000;"> 12 </span><span style="color: #339966;"><span style="color: #ff0000;">13</span></span><span style="color: #339966;"><span style="color: #ff0000;"> 14</span></span><span style="color: #339966;"><span style="color: #ff0000;"> 15 16 17 18 21 24 30 36 </span></span><strong><span style="color: #339966;">48 60 72</span></strong>:</p>
<h2>Dax</h2>
<p>Screenshots of Dax in <a href="/article-data/images/webfont-pop-dax-Firefox.png" target="_blank">Firefox</a>, <a href="/article-data/images/webfont-pop-dax-IE8.png">IE8</a>, <a href="/article-data/images/webfont-pop-dax-IE6.png">IE6</a> and <a href="/article-data/images/webfont-pop-dax-Safari.png">Safari</a>.</p>
<p>Dax is, to my surprise, doing a pretty job as a webfont. Almost no strange kerning in IE8 and almost no creative font interpretation in Firefox. For some reason are font sizes 21 and 24 bad for all characters, but other font sizes are doing well with the exception of a few characters.</p>
<div class="wp-caption alignnone" style="width: 101px"><img title="Firefox 3.6 PC: FF and IE8 both have trouble with the staircase in the e at various font sizes." src="/article-data/images/webfont-pop-dax-1.png" alt="Firefox 3.6 PC: FF and IE8 both have trouble with the staircase in the e at various font sizes." width="91" height="56" /><p class="wp-caption-text">Firefox 3.6 PC: FF and IE8 both have trouble with the diagonal line in the &#39;e&#39;. At various sizes it looks like a staircase.</p></div>
<div class="wp-caption alignnone" style="width: 122px"><img title="Firefox 3.6 PC: Both IE8 and FF have trouble with all characters at font size 21 and 24" src="/article-data/images/webfont-pop-dax-2.png" alt="Firefox 3.6 PC: Both IE8 and FF have trouble with all characters at font size 21 and 24" width="112" height="26" /><p class="wp-caption-text">Firefox 3.6 PC: Both IE8 and FF have trouble font size 21 and 24. Note that the lines do not always have the same thickness.</p></div>
<p>So we get this list of usable and unusable font sizes:<span style="color: #339966;"><strong><strong><br />
</strong></strong><span style="color: #ff0000;">9 10</span><strong> 11 12 13 14 15 16 17 18 </strong><span style="color: #ff0000;">21 24</span><strong> 30 36 </strong><span style="color: #ff0000;">48</span><strong><strong> 60 72</strong></strong></span></p>
<h2>Gill Sans</h2>
<p>Screenshots of Gill Sans Regular in <a href="/article-data/images/webfont-pop-gillSans-Firefox.png" target="_blank">Firefox</a>, <a href="/article-data/images/webfont-pop-gillSans-IE8.png">IE8</a>, <a href="/article-data/images/webfont-pop-gillSans-IE6.png">IE6</a> and <a href="/article-data/images/webfont-pop-gillSans-Safari.png">Safari</a>.<br />
Screenshots of Gill Sans Bold in <a href="/article-data/images/webfont-pop-gillSansBold-Firefox.png" target="_blank">Firefox</a>, <a href="/article-data/images/webfont-pop-gillSansBold-IE8.png">IE8</a>,  <a href="/article-data/images/webfont-pop-gillSansBold-IE6.png">IE6</a> and <a href="/article-data/images/webfont-pop-gillSansBold-Safari.png">Safari</a>.</p>
<p>Gill Sans Regular looks relatively nice. There are enough font sizes to choose from. Let&#8217;s focus on some rendering issues:</p>
<div class="wp-caption alignnone" style="width: 225px"><img title="Another example of the creativity of Firefox. You see some text in font size 16 and 17. Note the o and e on the top line that look like flat ellipsis." src="/article-data/images/webfont-pop-gillSans-1.png" alt="Another example of the creativity of Firefox. You see some text in font size 16 and 17. Note the o and e on the top line that look like flat ellipsis." width="215" height="52" /><p class="wp-caption-text">Another example of the &#39;creativity&#39; of Firefox. You see some text in font size 16 and 17. Note the &#39;o&#39; and &#39;e&#39; on the top line that look like flat ellipsis instead of perfect circles.</p></div>
<div class="wp-caption alignnone" style="width: 165px"><img title="IE8 Vista: Font size 14 looks nice. Except the captital T" src="/article-data/images/webfont-pop-gillSans-2.png" alt="IE8 Vista: Font size 14 looks nice. Except the captital T" width="155" height="33" /><p class="wp-caption-text">IE8 Vista: Font size 14 looks nice. Except the captital &#39;T&#39;, which is too thick.</p></div>
<div class="wp-caption alignnone" style="width: 312px"><img title="IE6 on XP SP3: IE6 does too much anti-aliasing, so that fonts at small sizes become almost a grey blur. Using a bold type can really make a difference." src="/article-data/images/webfont-pop-gillSans-3.png" alt="IE6 on XP SP3: IE6 does too much anti-aliasing, so that fonts at small sizes become almost a grey blur. Using a bold type can really make a difference." width="302" height="42" /><p class="wp-caption-text">IE6 on XP SP3 does too much anti-aliasing, so that text in small sizes become almost a grey blur. Using a bold style can really make a difference.</p></div>
<p>Usable and unusable font sizes for Gill Sans Regular:<span style="color: #339966;"><strong><strong><br />
</strong></strong><span style="color: #ff0000;">9 </span><span style="color: #339966;"><span style="color: #ff0000;">10 11 12</span></span><strong><span style="color: #339966;"> 13 </span></strong><span style="color: #ff0000;">14</span><strong><span style="color: #339966;"> 15 16 </span></strong><span style="color: #ff0000;">1<span style="color: #ff0000;">7</span></span><span style="color: #ff0000;"> 18 </span><span style="color: #ff0000;"><span style="color: #ff0000;">2</span>1</span><strong><span style="color: #339966;"> 24 </span></strong><span style="color: #ff0000;">30</span><strong><span style="color: #339966;"> </span></strong><span style="color: #339966;"><span style="color: #ff0000;">36</span></span><strong><span style="color: #339966;"> 48</span></strong><strong><strong><span style="color: #339966;"> 60 7</span>2</strong></strong></span></p>
<p>Usable and unusable font sizes for Gill Sans Bold:<span style="color: #339966;"><strong><strong><br />
</strong></strong><span style="color: #339966;"><span style="color: #ff0000;">9 10 11 12 13 14</span></span><strong><span style="color: #339966;"> 15 16 17 </span></strong><span style="color: #ff0000;">18</span><strong><span style="color: #339966;"> 21 24 30 36 48 60 72</span></strong></span></p>
<h2>Bodoni</h2>
<p>Screenshots of Bodoni Book in <a href="/article-data/images/webfont-pop-bodoni-Firefox.png" target="_blank">Firefox</a>, <a href="/article-data/images/webfont-pop-bodoni-IE8.png">IE8</a>, <a href="/article-data/images/webfont-pop-bodoni-IE6.png">IE6</a>.<br />
Screenshots of Bodoni Book Italic in <a href="/article-data/images/webfont-pop-bodoni-Firefox.png" target="_blank">Firefox</a>, <a href="/article-data/images/webfont-pop-bodoni-IE8.png">IE8</a>,   <a href="/article-data/images/webfont-pop-bodoni-IE6.png">IE6</a>.</p>
<div class="wp-caption alignnone" style="width: 214px"><img title="IE8: Even at large sizes the small lines tend to be troublesome. Note the broken lines in the o, e, p and s." src="/article-data/images/webfont-pop-bodoni-1.png" alt="IE8: Even at large sizes the small lines tend to be troublesome. Note the broken lines in the o, e, p and s." width="204" height="52" /><p class="wp-caption-text">IE8: Even at large sizes the small lines tend to be troublesome. Note the broken lines in the &#39;o&#39;, &#39;e&#39;, &#39;p&#39; and &#39;s&#39;.</p></div>
<div class="wp-caption alignnone" style="width: 173px"><img title="The grey blur of IE6" src="/article-data/images/webfont-pop-bodoni-2.png" alt="The grey blur of IE6" width="163" height="35" /><p class="wp-caption-text">The grey blur of IE6</p></div>
<p>Bodoni renders badly. As I expected. The thin lines in serif fonts prove to be troublesome in webfonts. This is mostly due to the anti-aliasing of IE8 that is way too sharp. The italic font style has a even worse legibility.</p>
<p>Usable and unusable font sizes for Bodoni Book:<span style="color: #339966;"><strong><strong><br />
</strong></strong><span style="color: #ff0000;">9 10 11 12</span><span style="color: #339966;"><span style="color: #ff0000;"> 13 14</span><strong> </strong><span style="color: #ff0000;">15 </span><span style="color: #ff0000;">16</span><strong> </strong><span style="color: #ff0000;">17</span><strong> </strong><span style="color: #ff0000;">18</span><span style="color: #ff0000;"> 21 24 30 36</span><strong> 48</strong></span><strong><strong><span style="color: #339966;"> 60 7</span>2</strong></strong></span></p>
<p>Usable and unusable font sizes for Bodoni Book Italic:<span style="color: #339966;"><strong><strong><br />
</strong></strong><span style="color: #ff0000;">9 10 11 12 13 14</span><span style="color: #339966;"><span style="color: #ff0000;"> 15 16 17 18</span><span style="color: #ff0000;"> 21 24</span><span style="color: #ff0000;"> 30  36</span><strong> 48 60 72</strong></span></span></p>
<h2>Conclusion</h2>
<p>Phew! that&#8217;s a lot of data. So what does it all mean? Well, for starters we now know for sure that you have to check your font in different browsers and eliminate the font sizes that render badly before you start to design. This and other tests seem to show that it&#8217;s best to only use simple, sans-serif fonts. That&#8217;s because variation in thickness and diagonal lines prove troublesome in webfonts. Especially in IE8 on Vista because it&#8217;s very sharp anti-alias. It&#8217;s so sharp that the fonts look jagged.</p>
<p>Fonts in Firefox don&#8217;t look jagged and look great in very large sizes. The trouble is the &#8216;creativity&#8217; in the rendering. Characters can be wider, smaller, higher or lower than intended. In some cases it can change the complete look of a font.</p>
<p>The anti-alias in IE6 on Windows XP SP3 is in most cases way to strong. Most black text is printed grey at smaller sizes. But in some cases the vertical lines of characters exactly fit in one pixel, which results in a pure black line in a grey text. Not good.</p>
<p>And Safari? You haven&#8217;t seen me talking about Safari. That&#8217;s because the font rendering in OSX is all you could wish for. That doesn&#8217;t mean I have seen some rendering issues, but they are of a complete other order and are insignificant compared with the troublesome rendering on Windows. Font rendering in the PC version of Safari is by the way just as bad as IE, if not worse.</p>
<p>I recently tried Typekit and seen webfonts on Ascenderfonts. The selected fonts look most of the time way better than you can do yourself. So I guess that webfont services is logical option, from both legally and legibility standpoint.</p>


<p>Related posts:<ol><li><a href='http://www.thebrightlines.com/2010/01/20/webfont-pitfalls/' rel='bookmark' title='Permanent Link: Webfont pitfalls'>Webfont pitfalls</a></li>
<li><a href='http://www.thebrightlines.com/2009/12/10/251/' rel='bookmark' title='Permanent Link: My favorite for converting fonts to EOT'>My favorite for converting fonts to EOT</a></li>
<li><a href='http://www.thebrightlines.com/2010/03/18/font-rendering-in-ie9/' rel='bookmark' title='Permanent Link: Web font rendering in IE9'>Web font rendering in IE9</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2010/01/24/test-popular-professional-fonts-as-webfont/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Cool cross-browser styling with CSS and IE&#8217;s filter</title>
		<link>http://www.thebrightlines.com/2009/12/03/using-ies-filter-in-a-cross-browser-way/</link>
		<comments>http://www.thebrightlines.com/2009/12/03/using-ies-filter-in-a-cross-browser-way/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 20:35:22 +0000</pubDate>
		<dc:creator>Wouter Bos</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[cross-browser]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://www.thebrightlines.com/?p=174</guid>
		<description><![CDATA[A few new and cool CSS3 styles become realistic options when building a website if you combine them with IE's filter.]]></description>
			<content:encoded><![CDATA[<p><a class="button demo" href="/article-data/demo/CSS3/CSS3.html" target="_blank"><span> </span>View demo</a>
<div class="clear"></div>
<p>A few new and cool CSS3 styles become realistic options if you are designing website. That is: as long as you combine them with IE’s counterpart filter.</p>
<p>The list of things that Safari, Chrome and Firefox support is getting larger and larger. Not all functionality is that interesting since we still have to make sure that IE users receive a functional site. And if you&#8217;re building something for a customer, you have to make sure that the website looks like what the customer expects it to look like. Most of the time that means that the website must be more or less an exact copy of the designs in Photoshop.</p>
<p>But what is easily forgotten is that for years Internet Explorer sort of supports some CSS styles through the proprietary <code>filter</code> property. I mostly use <code>filter</code> for setting opacity or forcing alpha channels in a PNG24, but when I saw a text shadow in a website I realized that IE can do that trick already for years. So I came up with this list of things that should work on almost any browser:</p>
<ul>
<li>Text shadow</li>
<li>Box shadow</li>
<li>Blur</li>
<li>Gradient background</li>
<li>Opacity</li>
<li>PNG24 alpha</li>
</ul>
<h2>A little on browser support</h2>
<p>A little warning about the “works in”-lines you&#8217;ll seewith each example. I didn&#8217;t dig very deep to see which version of Opera started to support text-shadow. If see in a support chart that Opera 9.62 supports text-shadow, I haven&#8217;t dug deeper to if it was also supported in Opera 9.61. Especially when I relate it to the small share of people who use that browser. If you can point a source that speaks of an earlier version, I&#8217;m more than happy to correct the article.</p>
<h2>Things you can do with CSS and filters combined</h2>
<h3>Text shadow</h3>
<p><strong>Works in IE 5.5+, Firefox 3.1b+, Safari 3+, Chrome 2+ and Opera 9.62+</strong><br />
Used sparingly can create a nice subtle effect and is a great way to make something a bit more stylish. Watch out with loss of anti-alias. More on that issue at the end of the article.</p>
<div class="wp-caption alignleft" style="width: 163px"><img title="Text-shadow in IE8" src="/article-data/images/IE-filter-textshadow-ie.png" alt="Text-shadow in IE8" width="153" height="13" /><p class="wp-caption-text">Text-shadow in IE8</p></div>
<div class="wp-caption alignleft" style="width: 165px"><img title="Text-shadow in Firefox 3.5.5" src="/article-data/images/IE-filter-textshadow-ff.png" alt="Text-shadow in Firefox 3.5.5" width="155" height="14" /><p class="wp-caption-text">Text-shadow in Firefox 3.5.5</p></div>
<pre name="code" class="css:nogutter">.textShadow {
	width: 250px;
	text-shadow: 1px 1px 1px #cccccc; /* CSS3-compatible browsers */
	filter: dropshadow(color=#cccccc, offx=1, offy=1) /* IE */
}</pre>
<h3>Blur</h3>
<p><strong>Works in IE 5.5+, Firefox 3.1b+, Safari 3+, Chrome 2+ and Opera 9.62+</strong><br />
This one is a bit of hack: CSS3&#8217;s <code>text-shadow</code> is misused to create a blur. It was a trick I saw on www.css-tricks.com (hence the name, I guess). And although you can see the differences between the two screenshots, both are definitely blurs. A <a href="/conditional-comments/">conditional comment</a> was used to make the text in IE a bit darker so it would match with other browsers.</p>
<div class="wp-caption alignleft" style="width: 79px"><img title="Blur in IE8" src="/article-data/images/IE-filter-blur-ie.png" alt="Blur in IE8" /><p class="wp-caption-text">Blur in IE8</p></div>
<div class="wp-caption alignleft" style="width: 85px"><img title="Blur in Firefox 3.5.5" src="/article-data/images/IE-filter-blur-ff.png" alt="Blur in Firefox 3.5.5" /><p class="wp-caption-text">Blur in Firefox 3.5.5</p></div>
<pre name="code" class="css:nogutter">.blur {
	width: 250px;
	color: #ddd;
	text-shadow: 0 0 2px #aaaaaa;
	text-shadow: 0 0 4px #aaaaaa;
	text-shadow: 0 0 6px #aaaaaa;
	filter:
		progid:DXImageTransform.Microsoft.MotionBlur(strength=1,direction=310)
		progid:DXImageTransform.Microsoft.Blur(pixelradius=2);
}</pre>
<pre name="code" class="css:nogutter">&lt;!--[if IE]&gt;
	&lt;style type="text/css"&gt;
		/* This style is for IE browsers only by
		   using IE's Conditional Comments */
		.blur {
			color: #aaaaaa;
		}
	&lt;/style&gt;
&lt;![endif]--&gt;</pre>
<h3>Opacity</h3>
<p><strong>Works in IE 5.5+ and in all major browsers for years and is safe to use</strong><br />
Definitely the most used combination of CSS and IE&#8217;s filter. I mostly use it to make the website almost invisible in favor of an absolute placed <code>div</code> which floats like popup window on top of the greyed out website.</p>
<div class="wp-caption alignleft" style="width: 149px"><img title="Opacity 0.5 in IE8" src="/article-data/images/IE-filter-opacity-ie.png" alt="Opacity 0.5 in IE8" /><p class="wp-caption-text">Opacity 0.5 in IE8</p></div>
<div class="wp-caption alignleft" style="width: 149px"><img title="Opacity 0.5 in Firefox 3.5.5" src="/article-data/images/IE-filter-opacity-ff.png" alt="Opacity 0.5 in Firefox 3.5.5" /><p class="wp-caption-text">Opacity 0.5 in Firefox 3.5.5</p></div>
<pre name="code" class="css:nogutter">.opacity {
	width: 250px;
	opacity: 0.5;
	-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";/*IE8+*/
	filter: alpha(opacity=50); /* IE7 and lower */
}</pre>
<h3>Gradient</h3>
<p><strong>Works in IE 5.5+, Firefox 3.6+, Safari4, Chrome 3+</strong><br />
The soon to be released Firefox 3.6 supports gradient background. Safari and Chrome already supports that cool CSS3 feature. Although you can do more with CSS3&#8217;s background gradient than IE&#8217;s filter, there&#8217;s nothing to stop you from using a simple gradient. Well, poor browser support may stop you. Firefox 3.6 still has to be released and Opera does not seem to support gradients at all.</p>
<p>So the browser support for gradients is less than desirable. But since all major browsers except Opera now supports gradients in their latest versions, it will become a useful styling tool soon.</p>
<div class="wp-caption alignleft" style="width: 180px"><img title="Background gradient in IE8" src="/article-data/images/IE-filter-gradient-ie.png" alt="Background gradient in IE8" /><p class="wp-caption-text">Background gradient in IE8</p></div>
<div class="wp-caption alignleft" style="width: 180px"><img title="Background gradient in Chrome 3.0" src="/article-data/images/IE-filter-gradient-chrome.png" alt="Background gradient in Chrome 3.0" /><p class="wp-caption-text">Background gradient in Chrome 3.0</p></div>
<pre name="code" class="css:nogutter">.gradient {
	background: -moz-linear-gradient(top, bottom,from(#cccccc),to(#888888));
	background: -webkit-gradient(linear, left top, left bottom, from(#cccccc), to(#888888)) no-repeat;
	background; -o-gradient(top, bottom,from(#cccccc),to(#888888));
	-ms-filter: "progid:DXImageTransform.Microsoft.gradient (GradientType=0, startColorstr=#ffcccccc, endColorstr=#ff888888)"; /* IE8+ */
	filter: progid:DXImageTransform.Microsoft.gradient (GradientType=0, startColorstr=#ffcccccc, endColorstr=#ff888888); /* IE7 and lower */
}</pre>
<h3>Box shadow</h3>
<p><strong>Works in IE 5.5+, Firefox 3.6+, Safari 3, Chrome 1</strong><br />
If you look at the screenshots below you see a striking difference in what is called a “Shadow“. IE&#8217;s box shadow looks more like the right and bottom side of a 3D object than a real life shadow. CSS3&#8217;s box-shadow provides a shadow that&#8217;s much more realistic.</p>
<p><img title="Box shadow in IE8" src="/article-data/images/IE-filter-shadow-ie.png" alt="Box shadow in IE8" /><img title="Box shadow in Firefox 3.5.5" src="/article-data/images/IE-filter-shadow-ff.png" alt="Box shadow in Firefox 3.5.5" /></p>
<pre name="code" class="css:nogutter">.boxShadow {
	-moz-box-shadow: 5px 5px 5px #888;
	-webkit-box-shadow: 5px 5px 5px #888;
	-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(color=#888888,direction=125,strength=5)"; /* IE8+ */
	filter: progid:DXImageTransform.Microsoft.Shadow(color=#888888,direction=125,strength=5); /* IE7 and lower */
	background: #cccccc;
}</pre>
<h3>Use alpha channel in PNG24 images</h3>
<p>Not really a CSS feature, neither something that lacks in modern IE browsers. But it is dearly missed in IE6. The only way to use alpha channels in IE6 (although many have found different ways apply it) is by using the filter&#8217;s AlphaImageLoader. Although this filter can save the day, it has many bugs you need to be aware of:</p>
<ul>
<li>It can only be used as a background image.</li>
<li>You cannot position it like a normal background image, nor can the image repeat itself on the <code>x</code> or <code>y</code> axis.</li>
<li>Links or form elements inside a box with a transparent PNG24 are not clickable. You have to make sure that such elements have a parent that has <code>position: relative</code>.</li>
<li>Having lots of relative positioned elements scattered around can add extra complexity to your website if it has absolute positioned items floating on top of each other as well.</li>
<li>You&#8217;ll lose text anti-alias.</li>
</ul>
<p><strong>This technique is only needed in IE6. Other modern browsers use the alpha channel as it ought to be.</strong></p>
<pre name="code" class="css:nogutter">.imageAlpha {
	display: block;
	width: 250px;
	height: 40px;
	padding: 5px 10px;
	background: #aaf url(alpha.png) 0 0 repeat-x; /* PNG24 image with alpha layer that works in all modern browsers */
}
* html .imageAlpha { /* these styles are only picked up by IE6 */
	background-image: none;
	filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='alpha.png', sizingMethod='scale')
}</pre>
<h2>Filter bugs</h2>
<h3>Filter can clear Cleartype</h3>
<p>The main drawback of using IE&#8217;s <code>filter</code> is that in some cases the element that has a filter style in IE, will lose it&#8217;s anti-aliasing. That may not sound like a big deal, because we have lived for a long time without Microsoft&#8217;s Cleartype, but it can get real ugly with larger fonts as you can see in the screenshots below. If you use a filter and it does remove the Cleartype, it&#8217;s best to keep the font-size 16 pixels or lower.</p>
<p><img title="IE filters in Arial 16px" src="/article-data/images/IE-filter2.png" alt="IE filters in Arial 16px" /><img title="IE filters in Georgia 19px" src="/article-data/images/IE-filter1.png" alt="IE filters in Georgia 19px" /></p>
<h3>Filters can only be applied to boxes</h3>
<p>Filters can only be applied to block elements like <code>div</code> or <code>p</code> and they need a width or height. If not, the filter won&#8217;t work. The exception to the rule is IE8, which can show filter effects without a width or height.</p>
<p><a class="button demo" href="/article-data/demo/CSS3/CSS3.html" target="_blank"><span> </span>View demo</a>
<div class="clear"></div>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2009/12/03/using-ies-filter-in-a-cross-browser-way/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
