<?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>PHP, CSS, HTML, Web &#38; beyond &#187; css</title>
	<atom:link href="http://www.joseairosa.com/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.joseairosa.com</link>
	<description>Programming Tips &#38; Tricks</description>
	<lastBuildDate>Mon, 23 Jan 2012 12:46:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Easy CSS Star Rating Layout</title>
		<link>http://www.joseairosa.com/2009/07/24/easy-css-star-rating-layout/</link>
		<comments>http://www.joseairosa.com/2009/07/24/easy-css-star-rating-layout/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 22:53:59 +0000</pubDate>
		<dc:creator>José P. Airosa</dc:creator>
				<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.joseairosa.com/?p=80</guid>
		<description><![CDATA[<img src="http://www.joseairosa.com/wp-content/uploads/2009/07/post_stars.jpg" alt="post_stars" title="post_stars" width="559" height="57" class="alignnone size-full wp-image-92" />

Today I bring you an easy and quick CSS tip for making Star Rating layouts, only with the use of CSS. The great thing about this one that I'm about to show you, is the fact that it's continuous, meaning, it will work with percentage.
Confused?

- Let me show you an example!]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.joseairosa.com/wp-content/uploads/2009/07/post_stars.jpg" alt="post_stars" title="post_stars" width="559" height="57" class="alignnone size-full wp-image-92" /></p>
<p>Today I bring you an easy and quick CSS tip for making Star Rating layouts, only with the use of CSS. The great thing about this one that I&#8217;m about to show you, is the fact that it&#8217;s continuous, meaning, it will work with percentage.<br />
Confused?</p>
<p>- Let me show you an example!</p>
<p><img class="alignnone size-full wp-image-81" title="stars1" src="http://www.joseairosa.com/wp-content/uploads/2009/07/Imagem-3.png" alt="stars1" width="99" height="28" style="margin-left: 3px;" /><br />
<img class="alignnone size-full wp-image-82" title="Imagem 4" src="http://www.joseairosa.com/wp-content/uploads/2009/07/Imagem-4.png" alt="Imagem 4" width="102" height="24" /></p>
<p>As you can see they&#8217;re not just full or not full, they&#8217;re half full, 1/4 full, etc&#8230;</p>
<p>To achieve this you only need to have 2 images, them being:<img src="http://www.joseairosa.com/wp-content/uploads/2009/07/stars.png" alt="stars_empty" title="stars_empty" width="91" height="17" class="alignnone size-full wp-image-86" /><img src="http://www.joseairosa.com/wp-content/uploads/2009/07/stars_full.png" alt="stars_full" title="stars_full" width="91" height="17" class="alignnone size-full wp-image-87" /></p>
<p>From now on it&#8217;s only CSS and a really simple HTML to call the code and inform the % that you would like to use.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p80code1'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p801"><td class="code" id="p80code1"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.classification</span> <span style="color: #00AA00;">&#123;</span> 
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">91px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">17px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.classification</span> <span style="color: #6666ff;">.cover</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">img/stars.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">91px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">17px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">101</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.classification</span> <span style="color: #6666ff;">.progress</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">img/stars_full.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">17px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">102</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Basically we overlap one image on top of the other and we control the amount of Star we want to show with a given width in percentage.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p80code2'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p802"><td class="code" id="p80code2"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;classification&quot;&gt;&lt;div class=&quot;cover&quot;&gt;&lt;/div&gt;&lt;div class=&quot;progress&quot; style=&quot;width: 27%;&quot;&gt;&lt;/div&gt;&lt;/div&gt;</pre></td></tr></table></div>

<p>Where you see <strong>style=&#8221;width: 27%;&#8221;</strong> just change to what ever % you would like to fill.</p>
<p>We&#8217;re done! Easy? No? Yes? Rocket Science Hard? Let me know what you think.</p>
<p>Best regards!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joseairosa.com/2009/07/24/easy-css-star-rating-layout/feed/</wfw:commentRss>
		<slash:comments>47</slash:comments>
		</item>
	</channel>
</rss>

