<?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>Ladysign Dev Blog &#187; website performance</title>
	<atom:link href="http://www.ladysign-apps.com/blog/tag/website-performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ladysign-apps.com/blog</link>
	<description>Girls can code.</description>
	<lastBuildDate>Mon, 12 Dec 2011 16:58:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Get rid of many page requests; use CSS sprites</title>
		<link>http://www.ladysign-apps.com/blog/code/css/get-rid-of-many-page-requests-use-css-sprites/</link>
		<comments>http://www.ladysign-apps.com/blog/code/css/get-rid-of-many-page-requests-use-css-sprites/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 14:07:19 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[generators]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[css sprites]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[website performance]]></category>

		<guid isPermaLink="false">http://ladysign-apps.com/blog/?p=818</guid>
		<description><![CDATA[<p><strong>Difficulty:</strong> 1 out of 5 stars<br />
This trick is so easy but unfortunately not much used on the web.<br />
There are 2 pro-reason, why you should start using spri[......]</p><p class='read-more'><a href='http://www.ladysign-apps.com/blog/code/css/get-rid-of-many-page-requests-use-css-sprites/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p><strong>Difficulty:</strong> 1 out of 5 stars<br />
This trick is so easy but unfortunately not much used on the web.<br />
There are 2 pro-reason, why you should start using sprites (a technique which is used a lot for 2D game-developing / making one big image file, containing all the site images) in CSS.</p>
<ol>
<li>Get rid of the image flickering. This is what happens when using roll-overs for multiple images, both images will be requested from the server. Although the time is pretty fast, you&#8217;ll will see the image flickering</li>
<li>Reduce page requests &#8211; One big image might be heavier to download, nowadays it will be faster and directly loaded in your page then requesting multiple images</li>
</ol>
<p>There are some handy Firefox tools, which you can use for website performance optimization:<br />
<a href="https://addons.mozilla.org/en-US/firefox/addon/3829">Live HTTP Headers</a> and <a href="http://getfirebug.com/net.html">Firebug</a>.<br />
Within Firebug, you can select the NET tab. From here you can see all the requests to images.</p>
<p>See the sprites which are used for <a href="http://g-ecx.images-amazon.com/images/G/01/gno/images/orangeBlue/navPackedSprites_v10._V224330185_.png">Amazon</a>, <a href="http://s.ytimg.com/yt/img/master-vfl102488.png">YouTube </a>or even for <a href="http://www.google.nl/images/nav_logo6.png">Google</a>.</p>
<p>There are even <a href="http://spritegen.website-performance.org">online tools</a> for generating these sprites, so you don&#8217;t need Photoshop for calculating.</p>
<p>How to implement it? &#8211; Just by smart using the background property.<br />
For example:</p>
<pre class="brush: css; title: ;">#navigation {
 width: 500px;
 height: 20px;
 overflow: hidden; //no image outside the defined clipping area is visible
}

#navigation a {
 display: block;
 width: 100px;
 height: 20px;
 text-indent: -10000px; //for removing the link text off the screen
 background-image: url(sprite.png) //link to your sprite image;
}

#nav-home a { background-position: 0 0; //position of sprite x y }
#nav-home a:hover { background-position: 0 100px; //note the changed y-position }
#nav-about a { background-position: 20px 0; }
#nav-about a:hover { background-position: 20px 100px;}</pre>
<p>You can put everything in your sprite, think about icons, backgrounds, borders and corners.<br />
It&#8217;s even possible to combine it with background repeating.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ladysign-apps.com/blog/code/css/get-rid-of-many-page-requests-use-css-sprites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

