<?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>Tiffany B. Brown &#187; CSS</title>
	<atom:link href="http://tiffanybbrown.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://tiffanybbrown.com</link>
	<description>A web log about web development and internet culture with frequent detours into other stuff.</description>
	<lastBuildDate>Wed, 23 May 2012 16:23:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Thoughts on practices for CSS Gradients</title>
		<link>http://tiffanybbrown.com/2011/04/06/thoughts-on-practices-for-css-gradients/</link>
		<comments>http://tiffanybbrown.com/2011/04/06/thoughts-on-practices-for-css-gradients/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 23:35:48 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[WebKit]]></category>
		<category><![CDATA[gradients]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/?p=5838</guid>
		<description><![CDATA[Examples of CSS gradients are cropping up in the wild, and with good reason. CSS gradients: don&#8217;t require the additional HTTP request of an image file. are easier to modify than image files. &#8220;weigh less&#8221; than most image files. That&#8217;s the ideal, at least. In their current state, gradients are actually a hot mess. The [...]]]></description>
			<content:encoded><![CDATA[<p>Examples of CSS gradients are cropping up in the wild, and with good reason. CSS gradients:</p>
<ul>
<li>don&#8217;t require the additional HTTP request of an image file.</li>
<li>are easier to modify than image files.</li>
<li>&#8220;weigh less&#8221; than most image files.</li>
</ul>
<p>That&#8217;s the ideal, at least. In their current state, gradients are actually a hot mess. The reality?</p>
<ul>
<li>The <a href="http://dev.w3.org/csswg/css3-images/#gradients">specification</a> is still in flux.</li>
<li>Full gradient support is not available in all modern browsers. (For now, Opera 11 only supports linear gradients.)</li>
<li>Many older, though relatively recent versions of browsers (Internet Explorer 8 &amp; 9, Opera 10 Desktop, Opera Mobile, and Opera Mini, for example) don&#8217;t suport CSS gradients at all.</li>
</ul>
<p>So, how can developers take advantage of gradients and still support older browsers? Let&#8217;s look at some approaches.</p>
<h2>Set a background color</h2>
<p>Take a look at the following CSS:</p>
<pre>
#linear{
    width:400px;
    height:300px;
    background-image: -moz-linear-gradient(top left, #f60 0%, #c09 50%, #fc0 100%);
    background-image: -webkit-gradient(linear, 0% 0%, 100% 100%, from(#f60), to(#fc0), color-stop(0.5,#c09) );
    background-image: -o-linear-gradient(top left, #f60 0%, #c09 50%, #fc0 100%);
}
</pre>
<p>This is a fairly common scenario. The developer (*cough*me*cough*) covered most of her bases, but forgot one: browsers that don&#8217;t support gradients at all. You can see what this looks like in Internet Explorer 9 (see <a href="#fig1_20110405">Figure 1</a>).</p>
<div class="img560" id="fig1_20110405"><img src="http://webinista.s3.amazonaws.com/images/uploads/2011/04/nogradientsupport.png" alt="What a gradient looks like in Internet Explorer 9"/>
<p>Figure 1. Internet Explorer 9 doesn&#8217;t yet support CSS gradients. This is what it looks like if you don&#8217;t supply a background color.</p>
</div>
<p>Now look at the following CSS:</p>
<pre>
#linear{
    width:400px;
    height:300px;
    background-color: #333;
    background-image: -moz-linear-gradient(top left, #f60 0%, #c09 50%, #fc0 100%);
    background-image: -webkit-gradient(linear, 0% 0%, 100% 100%, from(#f60), to(#fc0), color-stop(0.5,#c09) );
    background-image: -o-linear-gradient(top left, #f60 0%, #c09 50%, #fc0 100%);
}
</pre>
<p>Here we&#8217;ve set a background image, but we&#8217;ve also set a background color. Browsers that don&#8217;t support CSS gradients will ignore the last three lines. (Note: each browser also ignores the other browsers&#8217; vendor-specific prefixes.)</p>
<p>Setting a background color is the easiest fall back for older / less modern browsers.</p>
<h2>Set a background image using an external file</h2>
<p>Consider the following CSS.</p>
<pre>
#linear{
    width:400px;
    height:300px;
    background-image: url(migas.jpg);
    background-image: -moz-linear-gradient(top left, #f60 0%, #c09 50%, #fc0 100%);
    background-image: -webkit-gradient(linear, 0% 0%, 100% 100%, from(#f60), to(#fc0), color-stop(0.5,#c09) );
    background-image: -o-linear-gradient(top left, #f60 0%, #c09 50%, #fc0 100%);
}
</pre>
<p>In this example, we&#8217;re taking advantage of how browsers apply the cascade. As it turns out, Opera 11, Chrome whatever-the-heck-version-it&#8217;s-up-to, and Firefox 4 will not make the HTTP request for the external file. Safari, however, does (see <a href="#fig2_20110405">Figure 2</a>). Internet Explorer 9 (and less-modern browsers) will only load the external file. Depending on your audience, this may be an acceptable alternative.</p>
<div class="img560" id="fig2_20110405"><a href="http://webinista.s3.amazonaws.com/images/uploads/2011/04/safari-dowloads-migas.png"><img src="http://webinista.s3.amazonaws.com/images/uploads/2011/04/safari-dowloads-migas640.png" alt="Safari web inspector"/></a>
<p>Figure 2. Safari downloads all images. Click to embiggen.</p>
</div>
<p>Note: I have just barely tested this in mobile browsers. (Opera Mobile 11 doesn&#8217;t support gradients. Users will see the external image).</p>
<h2>Use SVG gradients to create a background image</h2>
<p>Internet Explorer 9 and Opera 10 (including Mobile) do not support CSS gradients. They do, however, both support the use of <abbr title="Scalable Vector Graphics">SVG</abbr> images as background images. Another alternative to using external images, then, is to use an SVG file.</p>
<pre>
#linear{
    width:400px;
    height:300px;
    background-image: url(gradient.gif);
    background-image: url(gradient.svg);
}
</pre>
<p>This example works in all current desktop browsers, and most mobile browsers. Safari 5, again, will download both images. Most others will download the latter SVG image. The advantages here are clarity and (arguably) ease of maintenance. Want a different gradient? Change the images. </p>
<p>You should be aware, though, that some recent(-ish) versions of mobile WebKit &#8212; such as the T-Mobile myTouch 4G browser &#8212; don&#8217;t support SVG backgrounds.  You&#8217;ll still need to add a linear gradient for those browsers, or set a background color.</p>
<h2>Or keep doing what we&#8217;ve been doing</h2>
<p>Of course, the growth of SVG and CSS gradients support doesn&#8217;t preclude using GIF, PNG or JPG gradients. The biggest point in favor of using bitmap images is that they still work in older browsers <em>and</em> current ones. </p>
<p>As with any aspect of web development, the right approach should balance concerns of maintainability, file size, and the browser distribution of your audience.</p>
<h2>You left out <code style="text-transform:lowercase;">linear-gradient</code>!</h2>
<p>I left it out of the examples above for two reasons: (1) simplicity; and (2) the syntax could change (though if I had to predict, it won&#8217;t change by much). Be forward-thinking! There are very few reasons not to include the proposed linear-gradient syntax in your code.</p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2011/04/06/thoughts-on-practices-for-css-gradients/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>On IE8: Pragmatic and practical, but I still don&#8217;t like it</title>
		<link>http://tiffanybbrown.com/2008/01/25/internet-explorer-8-version-targeting-meta-tag/</link>
		<comments>http://tiffanybbrown.com/2008/01/25/internet-explorer-8-version-targeting-meta-tag/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 16:38:26 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[(x)HTML]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Web Development & Programming]]></category>
		<category><![CDATA[Web standards]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[ie8]]></category>
		<category><![CDATA[webdevelopment]]></category>
		<category><![CDATA[webstandards]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/2008/01/25/internet-explorer-8-version-targeting-meta-tag/</guid>
		<description><![CDATA[For some background on this post, please start by reading Aaron Gustafson&#8217;s Beyond DOCTYPE: Web Standards, Forward Compatibility, and IE8 on this week&#8217;s edition of A List Apart, or any of the links from my Internet Explorer 8 round-up post. This post is an extended version of my comment there. About 6 years ago, I [...]]]></description>
			<content:encoded><![CDATA[<p class="editors-note">For some background on this post, please start by reading Aaron Gustafson&#8217;s <a href="http://alistapart.com/articles/beyonddoctype">Beyond DOCTYPE: Web Standards, Forward Compatibility, and IE8</a> on this week&#8217;s edition of <span class="website title">A List Apart</span>, or any of the links from my <a href="http://tiffanybbrown.com/2008/01/22/internet-explorer-8-round-up/">Internet Explorer 8 round-up</a> post. This post is an extended version of my <a href="http://tiffanybbrown.com/2008/01/22/internet-explorer-8-round-up/#comment-90568">comment</a> there.</p>
<p>About 6 years ago, I remember taking part in a conversation about preferred browsers on the <a href="http://janemag.com/" class="magazine title">Jane</a> magazine message boards. IE 5.x was still king of the PC world. IE 6 was coming on strong. Netscape 4 was still widely used by universities. Netscape 6 was on its way. </p>
<p>Most of the respondents said they preferred Internet Explorer. Why? Because sites just &#8220;look right&#8221; and &#8220;work better&#8221; in Internet Explorer. My response at the time was simple: if a site doesn&#8217;t work in Netscape, <em>it&#8217;s because the web developer didn&#8217;t know what (s)he was doing</em>.  </p>
<p>Of course, they didn&#8217;t care. They were far more into Sephora than HTML code quality. As far as they were concerned, Netscape was the problem. They didn&#8217;t blame crap code, or Microsoft for developing a browser that stomped harder than a Catalonian flamenco dancer all over the W3C specs and allowed ugly code to thrive. <strong>They blamed Netscape</strong>.</p>
<p>I was reminded of that conversation when I first read Microsoft&#8217;s recent announcement about Internet Explorer 8. After my initial  <q class="i">D*MNF*CKINGBLOODYHELL!JUSTBREAKTHF*CKINGWEBALREADYMICROSOFT!WHATTHEF*CK? IAMTIREDOFYOURAGGEDYBASTARDSMAKINGMYDAYJOB1000TIMESHARDERTHANITNEEDSTOBEBECAUSEYOUCAN&#8217;T DEVELOPABROWSERTHATFOLLOWSAF*CKING10YEAROLDSPEC!!!</q> reaction passed, I came to the following conclusion: <strong>this is the best approach to a bad situation</strong>.</p>
<p>Microsoft does not want to be where Netscape was. It&#8217;s a sad but true fact is that if a site breaks, the average web user &#8212; and, dare I say, average web developer &#8212; will <strong>blame the browser</strong>. Microsoft is too entrenched in corporate intranets and applications to let that happen. Doing so would cause a sh*tstorm of massive proportions for the company. From a business perspective, I understand. </p>
<p>And while I am also not happy about the default implementation (as <cite>Jeremy Keith</cite> explained <q cite="http://adactio.com/journal/1402">Unless you explicitly declare that you want IE8 to behave as IE8, it will behave as IE7.</q>), <strong>opting-in to web standards eliminates the need to revise existing code</strong>. </p>
<p>Yes, it&#8217;s potentially a nail in the coffin for <a href="http://en.wikipedia.org/wiki/Progressive_enhancement">progressive enhancement</a> techniques. Yes, we&#8217;ll still have to do something special to cater to Microsoft browsers. <ins datetime="2008-01-25T16:48:14+00:00">Yes, this could freeze web development at the IE7 level for years to come.</ins> But I believe &#8212; and it pains me to say it given the hate-hate more relationship I have with Microsoft browsers &#8212; that <strong>Microsoft, given its position, had no other choice</strong>.</p>
<p>But putting pragmatic approaches and practical considerations aside, I think <a href="http://weblog.200ok.com.au/2008/01/opt-out-version-targeting-is-spam.html"><cite>Ben Buchanan</cite></a> said it best: </p>
<blockquote cite="http://weblog.200ok.com.au/2008/01/opt-out-version-targeting-is-spam.html"><p>
If they&#8217;ve included a <code>DOCTYPE</code>, they&#8217;ve declared they want to render to standards. If they did that in ignorance, it&#8217;s time they started earning their money instead of letting <span class="software">Dreamweaver<span> do their jobs.<br />
</span></span></p></blockquote>
<p><b>Related:</b> <a href="http://tiffanybbrown.com/2008/01/22/internet-explorer-8-round-up/">Internet Explorer 8 Round Up</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2008/01/25/internet-explorer-8-version-targeting-meta-tag/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Recommended: Anil Dash&#8217;s &#8216;Google and Theory of Mind&#8217;</title>
		<link>http://tiffanybbrown.com/2007/12/14/recommended-anil-dashs-google-and-theory-of-mind/</link>
		<comments>http://tiffanybbrown.com/2007/12/14/recommended-anil-dashs-google-and-theory-of-mind/#comments</comments>
		<pubDate>Fri, 14 Dec 2007 22:04:13 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Internet life]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[amazon simpledb]]></category>
		<category><![CDATA[amazon.com]]></category>
		<category><![CDATA[anil dash]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[opera browser]]></category>
		<category><![CDATA[the issue]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/2007/12/14/recommended-anil-dashs-google-and-theory-of-mind/</guid>
		<description><![CDATA[Anil analyzes Google&#8217;s Knol product and suggests that Google may be dancing awfully close to the &#8216;evil&#8217; line. Two points to think about: Theory of mind is the awareness that others are aware, and its absence is the weakness that Google doesn&#8217;t know it has. This shortcoming exists at a deep cultural level within the [...]]]></description>
			<content:encoded><![CDATA[<p><cite>Anil</cite> <a href="http://www.dashes.com/anil/2007/12/google-and-theory-of-mind.html">analyzes</a> Google&#8217;s <a href="http://googleblog.blogspot.com/2007/12/encouraging-people-to-contribute.html">Knol</a> product and suggests that Google may be dancing awfully close to the &#8216;evil&#8217; line.</p>
<p>Two points to think about:</p>
<blockquote cite="Anil Dash; http://www.dashes.com/anil/2007/12/google-and-theory-of-mind.html"><p>
Theory of mind is the awareness that others are aware, and its absence is the weakness that Google doesn&#8217;t know it has. This shortcoming exists at a deep cultural level within the organization, and it keeps manifesting itself in the decisions that the company makes about its products and services. The flaw is one that is perpetuated by insularity, and will only be remedied by becoming more open to outside ideas and more aware of how people outside the company think, work and live.
</p></blockquote>
<p>And:</p>
<blockquote cite="Anil Dash; http://www.dashes.com/anil/2007/12/google-and-theory-of-mind.html"><p>
An awareness of how a transformation in the fundamental value of links from informational to economic could have led Google to develop a system that separated editorial and aesthetic choices from economic ones, preventing the eventual link-spam arms race.
</p></blockquote>
<h3>Also of note today (with some stuff from yesterday):</h3>
<ul>
<li><a href="http://www.readwriteweb.com/archives/the_blogosphere_gets_a_newspaper_the_issue.php">The Blogosphere Gets a Newspaper in The Issue</a></li>
<li><a href="http://www.amazon.com/gp/browse.html?node=342335011">Amazon launches SimpleDB (in a limited beta)</a> (Related: <a href="http://www.satine.org/archives/2007/12/13/amazon-simpledb/">What You Need To Know About Amazon SimpleDB</a> via <a href="http://www.readwriteweb.com/">Read/Write Web</a>)</li>
<li><a href="http://www.opera.com/pressreleases/en/2007/12/13/">Opera files antitrust complaint with the EU</a> (Analysis: <a href="http://www.stuffandnonsense.co.uk/malarkey/more/css_unworking_group/">CSS Unworking Group</a> by Andy Clarke)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2007/12/14/recommended-anil-dashs-google-and-theory-of-mind/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

