<?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>Confessions of a Guru &#187; css</title>
	<atom:link href="http://www.guru.net.nz/blog/category/css/feed" rel="self" type="application/rss+xml" />
	<link>http://www.guru.net.nz/blog</link>
	<description>Random stuff from a Dunedin (NZ) based web developer, beer drinker and dad</description>
	<lastBuildDate>Wed, 14 Dec 2011 09:18:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Web 2.0 Reflection using HTML and CSS only</title>
		<link>http://www.guru.net.nz/blog/2009/07/web-20-reflection-using-html-and-css-only.html</link>
		<comments>http://www.guru.net.nz/blog/2009/07/web-20-reflection-using-html-and-css-only.html#comments</comments>
		<pubDate>Mon, 27 Jul 2009 11:45:01 +0000</pubDate>
		<dc:creator>GuruBob</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.guru.net.nz/blog/?p=285</guid>
		<description><![CDATA[You&#8217;re most probably familiar with the Web 2.0 reflection technique.  This technique is used to make products appear as if they&#8217;re on a shiny surface.  Apple most probably have it in use in their current campaign on the Apple website. I was thinking about this technique as it can be quite fiddly to put together.  [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;re most probably familiar with the Web 2.0 reflection technique.  This technique is used to make products appear as if they&#8217;re on a shiny surface.  Apple most probably have it in use in their current campaign on the <a href="http://www.apple.com/">Apple website</a>.</p>
<p>I was thinking about this technique as it can be quite fiddly to put together.  Normally you would use Photoshop or The Gimp or Inkscape to apply a gradient to an existing image, and then save that image as a seperate one, making sure you keep your original should you need it.</p>
<p>I then realised that by using a combination of CSS background images, background-position and opacity you could reproduce this effect purely with HTML and CSS.  I&#8217;m yet to wrap up the finer points but here&#8217;s the idea.</p>
<ol>
<li>Include your image on the page with an &lt;img &#8230;/&gt; tag as per usual.</li>
<li>Underneath the image, include a number of 1px high empty &lt;div&gt; tags.</li>
<li>On each div tag, set the background-image to be the same as the image referenced in step 1, set the background-position such that the 1px high div is displaying the correct row from the image, and set the opacity such that it fades out a little more on each subsequent div.</li>
</ol>
<p>This image illustrates the effect up close:</p>
<p><a href="http://www.guru.net.nz/blog/wp-content/uploads/2009/07/path3240.png"><img class="alignnone size-full wp-image-286" title="path3240" src="http://www.guru.net.nz/blog/wp-content/uploads/2009/07/path3240.png" alt="" width="250" height="268" /></a></p>
<p>My concerns at this point are:</p>
<ol>
<li>What effect will this technique have on older browsers?</li>
<li>How will this break across browsers? (I&#8217;m assuming it won&#8217;t be perfect)</li>
<li>The extra HTML for one image is maybe acceptable, but many images on a page would significant slow down load time for the sake of some shine</li>
<li>What effect &#8211; if any &#8211; will this have on SEO?</li>
</ol>
<p>I&#8217;m considering writing a jQuery plugin that you could use to apply this technique.  <a href="http://www.guru.net.nz/blog/shine.html">You can see the technique in actual use on this page</a>.  View the source code to see how it&#8217;s done.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guru.net.nz/blog/2009/07/web-20-reflection-using-html-and-css-only.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

