<?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>Web Design Talk &#187; css</title>
	<atom:link href="http://www.web-design-talk.co.uk/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.web-design-talk.co.uk</link>
	<description>Web Design &#38; Development Blog</description>
	<lastBuildDate>Wed, 28 Jul 2010 21:50:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>CSS Sprities and Website Optimization</title>
		<link>http://www.web-design-talk.co.uk/88/css-sprities-and-website-optimization/</link>
		<comments>http://www.web-design-talk.co.uk/88/css-sprities-and-website-optimization/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 21:10:19 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[sprities]]></category>
		<category><![CDATA[website optimisation]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.web-design-talk.co.uk/?p=88</guid>
		<description><![CDATA[One of the latest and most well established design practices are CSS sprites. This is the practice of combing multiple images into a larger and single, composite image. By using the CSS background-position property selected portions of that master image (or sprite) are displayed. The main issue here is how can a larger image witha [...]]]></description>
			<content:encoded><![CDATA[<p>One of the latest and most well established design practices are CSS sprites. This is the practice of combing multiple images into a larger and single, composite image. By using the <a href="http://www.w3schools.com/css/pr_background-position.asp">CSS background-position property</a> selected portions of that master image (or sprite) are displayed. The main issue here is how can a larger image witha larger file size be beneficial, especially when compared to several smaller images? The answer lies in HTTP requests and <a href="http://yuiblog.com/blog/2006/11/28/performance-research-part-1/">Yahoo&#8217;s 80/20 rule</a> explains this much better than I could! To summarise, the numbers of HTTP requests to the websites is drastically cut, thus loading the page much faster in  single request. Another major beenfit is that not Javascript is required for mouseover code, so you can make image rollovers easily. I have used this technque in the past, but like a lot of people never knew it was called sprites.</p>
<p>In fact, using sprites are so effective many of the internets biggest site&#8217;s are using them, all in slightly different ways. On such sites a truely huge number of requests are saved every day. For example, Youtube, Google, AOL,  Amazon and Apple all use CSS sprites. Take the mimilist example of Google (left):</p>
<div class="wp-caption alignleft" style="width: 160px"><img title="Google CSS Sprite" src="http://www.google.ca/images/nav_logo3.png" alt="Google CSS Sprite" width="150" height="105" /><p class="wp-caption-text">Google CSS Sprite</p></div>
<p>Youtube, does things slightly different and uses a absolutely <a href="http://s.ytimg.com/yt/img/master-vfl89407.png">massive sprite 2800px in height</a>! You&#8217;ll notice that some sprites are tightly packed together and other have spacing around each image. This is to allow for browser based text sizing, that would otherwise display multiple background images. A good example of planning for such an occurance is <a href="http://digg.com//img/menu-current.gif">Digg&#8217;s sprite</a>, where each image is highly spaced out.</p>
<p>The CSS is relatively simple. Take the example of a simple unordered list with a different image for each item. I made a <a href="http://web-design-talk.co.uk/examples/3/yada.png">very simple sprite </a>and applied the background-position property to each link class. Here&#8217;s the simple HTML used for the list:<span id="more-88"></span></p>
<pre class="brush: xml;">
&lt;ul id=&quot;sprites&quot;&gt;
	&lt;li&gt;&lt;a class=&quot;exclamation&quot; href=&quot;#&quot;&gt;Top Product&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a class=&quot;hot&quot; href=&quot;#&quot;&gt;Sizzlin Offers&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a class=&quot;offer&quot; href=&quot;#&quot;&gt;Special Deals&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>..and the CSS:</p>
<pre class="brush: css;">#sprites li {
 	list-style-type:none;
	font-size:1.1em;
	display: inline;
}
#sprites li a {
	background-image:url('yada.png');
	background-repeat:no-repeat;
	padding:5px 35px;
	line-height:35px;
	text-decoration: none;
	color: #333;
}
#sprites li a:hover {
text-decoration: underline
}
#sprites li a.hot {background-position:0px -165px}
#sprites li a.exclamation { background-position: 0px 0px; }
#sprites li a.offer { background-position: 0 -82px; }</pre>
<p>The <a href="http://web-design-talk.co.uk/examples/3/">final result</a> is a horizontal list, using a single image for the icons &#8211; no CSS hacks required for correct display in all the latest browsers! I won&#8217;t bother explaing the HTML or CSS as is self explanatory and very simple.</p>
<p>I personally find CSS sprites most useful for application icons as I can easily add a new icon class and set the background position accordingly. For instance, I&#8217;m currently working on a project that uses a lot of the fabulous <a href="http://www.famfamfam.com/lab/icons/silk/">famfamfam silk icons</a> and have used a <a href="http://www.famfamfam.com/lab/icons/silk/previews/index_abc.png">sprite similar to that on their site</a>. While this is a lot of work initially, my recent discovery the <a href="http://spritegen.website-performance.org/">sprite generator</a> has limited this work load.</p>
<p>Sprites can be used a for avriety of things, including simple image rollovers &#8211; see a quick example I put together using a simple hyperlink and a single background image (image from <a href="http://michaelmknight.deviantart.com/art/Virus-Shield-59357349">devianrt</a>). When I hover on the logo the background-position property simply shifts the spirite to right. You can view the <a href="http://web-design-talk.co.uk/examples/3/css-sprite-single-image.php">result right here</a>!</p>
<p>As with everything, you can take this idea a stage further and apply some JQuery to the mix to <a href="http://www.alistapart.com/articles/sprites2">create an amazing Flash like menu</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.web-design-talk.co.uk/88/css-sprities-and-website-optimization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>301 Redirects for SEO Using htaccess</title>
		<link>http://www.web-design-talk.co.uk/20/301-redirects-for-seo-using-htaccess/</link>
		<comments>http://www.web-design-talk.co.uk/20/301-redirects-for-seo-using-htaccess/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 21:08:07 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Jquery Framework]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[useability]]></category>

		<guid isPermaLink="false">http://www.web-design-talk.co.uk/?p=20</guid>
		<description><![CDATA[Google treats www.website.com and website.com as two totally different websites. This is very bad for your (or even a client's) website as it may lead to duplicate content and different pageranks to those sites.  This is how Google "canonicalizes" the url and is very bad from an SEO standpoint.]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignleft" style="width: 130px"><img title="404 vs 301" src="http://www.web-design-talk.co.uk/images/404-vs-301-redirect.jpg" alt="301 Redirects Prevent 404 Errors" width="120" height="120" /><p class="wp-caption-text">301 Redirects Prevent 404 Errors</p></div>
<p>Google treats www.website.com and website.com as two totally different websites. This is very bad for your (or even a client&#8217;s) website as it may lead to duplicate content and different pageranks to those sites.  This is how Google &#8220;canonicalizes&#8221; the url and is very bad from an SEO standpoint.</p>
<p>In essence, a web server could return totally different results for each of those pages. I have also encountered the situation where clients have set their preferred domain in Google webmaster tools, have given out the opposite version for SEM and wonder why they don&#8217;t see results <img src='http://www.web-design-talk.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> You can easily check the above by using the &#8220;site:&#8221; operator in Google search. E.g. site:www.website.com and site:website.com</p>
<p>You can use &#8220;mod rewrite&#8221; rules as a powerful method for redirecting many URLs from one location to another.  This is a simple server level technique for handling redirects. The way people handle this canonicalization issue is purely a personal choice, although the below method can be altered for directing to the none www version of the url.</p>
<p>The .htaccess file is simply an ASCII file created with any normal text editor. You need to save the file as &#8216;.htaccess&#8217; (no filename, .htaccess is the extension!). Open you newly created .htaccess file in your favoured text editor and add the following lines of code, replacing domain.com with your domain:</p>
<pre class="brush: xml;">
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]</pre>
<p>Upload the .htaccess file to the root folder of your website and you&#8217;re done. All your traffic will be permanently redirected from a non-www version of your website to a www version of your website. To do the opposite (direct all traffic to the non www version use the below code in the .htaccess file):</p>
<pre class="brush: xml;">RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.com
RewriteRule (.*) http://domain.com/$1 [R=301,L]
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.web-design-talk.co.uk/20/301-redirects-for-seo-using-htaccess/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Resources</title>
		<link>http://www.web-design-talk.co.uk/resources/</link>
		<comments>http://www.web-design-talk.co.uk/resources/#comments</comments>
		<pubDate>Sat, 11 Jul 2009 15:55:45 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Jquery Framework]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[useability]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.web-design-talk.co.uk/?page_id=5</guid>
		<description><![CDATA[Content Soon&#8230;.]]></description>
			<content:encoded><![CDATA[<p>Content Soon&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.web-design-talk.co.uk/resources/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Who?</title>
		<link>http://www.web-design-talk.co.uk/about/</link>
		<comments>http://www.web-design-talk.co.uk/about/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 21:02:01 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Jquery Framework]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[useability]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.web-design-talk.co.uk/?page_id=2</guid>
		<description><![CDATA[http://www.web-design-talk.co.uk I am a full-time developer for an internet company located in Staffordshire (Midlands) of the United Kingdom. I have been designing and coding websites for over 2 years using PHP, ASP, JQuery, XHTML, CSS and JavaScript. I have been lucky to work on a wide variety of projects from small intranet sites, personal websites [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.web-design-talk.co.uk/">http://www.web-design-talk.co.uk</a></p>
<p>I am a full-time developer for an internet company located in Staffordshire (Midlands) of the United Kingdom. I have been designing and coding websites for over 2 years using PHP, ASP, <a title="JQuery.com" href="http://www.jquery.com">JQuery</a>, XHTML, CSS and JavaScript. I have been lucky to work on a wide variety of projects from small intranet sites, personal websites and full e-commerce storefronts. I am currently available on a limited basis for interesting freelance work. I also offer the following services (although you can contact me via email to discuss web services not mentioned here):</p>
<ul>
<li>SEO / Website Marketing / Offsite SEO</li>
<li>Bespoke Website Design/Development</li>
<li>Website Updates</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.web-design-talk.co.uk/about/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
