<?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>bavotasan.com &#187; image</title>
	<atom:link href="http://bavotasan.com/tag/image/feed/" rel="self" type="application/rss+xml" />
	<link>http://bavotasan.com</link>
	<description>by c.bavota</description>
	<lastBuildDate>Tue, 07 Feb 2012 15:42:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using :target to Create a Lightbox Effect with CSS3</title>
		<link>http://bavotasan.com/2012/using-target-to-create-a-lightbox-effect-with-css3/</link>
		<comments>http://bavotasan.com/2012/using-target-to-create-a-lightbox-effect-with-css3/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 15:42:10 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[lightbox]]></category>
		<category><![CDATA[pseudo class]]></category>
		<category><![CDATA[transition]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=3794</guid>
		<description><![CDATA[If you&#8217;ve messed around with CSS3 you have probably seen some of the new pseudo classes pop up here and there. An interesting one that I just started to use is :target. A full explanation of what it does can be found on the W3 site but for the purposes of this tutorial, we will [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve messed around with CSS3 you have probably seen some of the new pseudo classes pop up here and there. An interesting one that I just started to use is <code>:target</code>. A full explanation of what it does can be found on the <a href="http://www.w3.org/TR/selectors/#target-pseudo">W3 site</a> but for the purposes of this tutorial, we will be using it to create a Lightbox effect. I actually developed this for <a href="http://presswork.me">PressWork</a> and so I decided to call it Pressbox.</p>
<p>First we need to create a thumbnail and surround it with an anchor tag.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#image1&quot;</span><span style="color: #339933;">&gt;&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://yoursite.com/images/image1.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #339933;">/&gt;&lt;/</span>a<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>The <code>href</code> parameter is very important since it will be what links our thumbnail to our larger image. We will use the same name as the ID in our larger image like so:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;image1&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pressbox&quot;</span><span style="color: #339933;">&gt;&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://yoursite.com/images/image1-big.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>The larger image needs a class that we can reference. I used <code>pressbox</code> but you can use whatever you want as long as you modify the CSS accordingly. Here is the CSS that will get everything working properly:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.pressbox</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">fixed</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</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;">9999</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.7</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span>
&nbsp;
	<span style="color: #6666ff;">.pressbox</span> img	<span style="color: #00AA00;">&#123;</span>
		opacity<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
		<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
		<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;">;</span>
		<span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
		-webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span> <span style="color: #933;">15px</span> <span style="color: #cc00cc;">#444</span><span style="color: #00AA00;">;</span>
		-moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span> <span style="color: #933;">15px</span> <span style="color: #cc00cc;">#444</span><span style="color: #00AA00;">;</span>	
		box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span> <span style="color: #933;">15px</span> <span style="color: #cc00cc;">#444</span><span style="color: #00AA00;">;</span>	
		-moz-transition<span style="color: #00AA00;">:</span> opacity .25s ease-in-out<span style="color: #00AA00;">;</span>
		-webkit-transition<span style="color: #00AA00;">:</span> opacity .25s ease-in-out<span style="color: #00AA00;">;</span>
		transition<span style="color: #00AA00;">:</span> opacity .25s ease-in-out<span style="color: #00AA00;">;</span>		
		<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.pressbox</span><span style="color: #3333ff;">:target </span><span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span>
&nbsp;
	<span style="color: #6666ff;">.pressbox</span><span style="color: #3333ff;">:target </span>img <span style="color: #00AA00;">&#123;</span>
		opacity<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
		<span style="color: #00AA00;">&#125;</span></pre></div></td></tr></table></div>

<p>We&#8217;ve added an opacity transition so that our Pressbox will fade in once we click on the thumbnail. This will all work because of the <code>:target</code> pseudo class that will display the the element that uses the same ID that is referenced by the <code>href</code> parameter in the thumbnail&#8217;s anchor tag.</p>
<p>You can test it out below. </p>
<p><a href="#image1"><img src="http://bavotasan.com/wp-content/uploads/2012/02/pressbox-demo.jpg" alt="" title="pressbox-demo" width="200" height="150" class="alignnone size-full wp-image-3796" /></a><br />
<a href="#" id="image1" class="pressbox"><img src="http://bavotasan.com/wp-content/uploads/2012/02/pressbox-demo-big.jpg" alt="" title="pressbox-demo-big" width="800" height="536" class="alignnone size-full wp-image-3795" /></a></p>
<p>Remember that this will only work in the following browsers: </p>
<ul>
<li>Firefox 1.0+</li>
<li>Safari 3.1+</li>
<li>Opera 9.5+</li>
<li>Chrome 2+</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2012/using-target-to-create-a-lightbox-effect-with-css3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Rotated Images with CSS3</title>
		<link>http://bavotasan.com/2011/rotated-images-with-css3/</link>
		<comments>http://bavotasan.com/2011/rotated-images-with-css3/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 15:00:34 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[Stylesheet]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=3585</guid>
		<description><![CDATA[I have been playing around with a lot of CSS3 lately due to PressWork, and I&#8217;ve come up with some cool tricks. One that I really like uses the transform style to create a rotated image. If you surround it with a div container and mask the outer edges, you get a pretty awesome effect. [...]]]></description>
			<content:encoded><![CDATA[<p>I have been playing around with a lot of CSS3 lately due to <a href="http://presswork.me">PressWork</a>, and I&#8217;ve come up with some cool tricks. One that I really like uses the transform style to create a rotated image. If you surround it with a div container and mask the outer edges, you get a pretty awesome effect.</p>
<p>Let&#8217;s take a look at the HTML required:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;image-box&quot;</span><span style="color: #339933;">&gt;</span>
   <span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://your-site/images/your-image.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span> width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;300&quot;</span> height<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;200&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>That is pretty straightforward enough and it gives us something like this:</p>
<div class="image-box">
   <img src="http://bavotasan.com/wp-content/uploads/2011/08/camera.jpg" alt="" width="300" height="200" />
</div>
<p>We need some CSS to get it looking how we want:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.image-box</span> img <span style="color: #00AA00;">&#123;</span> 
   transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>15deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
   -moz-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>15deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
   -webkit-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>15deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
   <span style="color: #00AA00;">&#125;</span></pre></div></td></tr></table></div>

<p>That gives us:</p>
<div class="image-box1">
   <img src="http://bavotasan.com/wp-content/uploads/2011/08/camera.jpg" alt="" width="300" height="200" />
</div>
<p>Not exactly what we want, but we&#8217;re getting there.</p>
<p>Let&#8217;s crop the div container to mask out the image&#8217;s edges:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.image-box</span> <span style="color: #00AA00;">&#123;</span> 
   <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
   <span style="color: #00AA00;">&#125;</span></pre></div></td></tr></table></div>

<p>Our image now looks like this:</p>
<div class="image-box2">
   <img src="http://bavotasan.com/wp-content/uploads/2011/08/camera.jpg" alt="" width="300" height="200" />
</div>
<p>We need to center it within the div container and that requires a few modifications to the CSS:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.image-box</span> <span style="color: #00AA00;">&#123;</span> 
   <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</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: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.image-box</span> img <span style="color: #00AA00;">&#123;</span> 
   transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>15deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
   -moz-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>15deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
   -webkit-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>15deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</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;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50%</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50%</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-100px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">-150px</span><span style="color: #00AA00;">;</span>
   <span style="color: #00AA00;">&#125;</span></pre></div></td></tr></table></div>

<div class="image-box3">
   <img src="http://bavotasan.com/wp-content/uploads/2011/08/camera.jpg" alt="" width="300" height="200" />
</div>
<p>That&#8217;s exactly what we want. It might look a little plain but now that you have the basic idea, you can add some more CSS to make it look even better:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.image-box</span> <span style="color: #00AA00;">&#123;</span> 
   <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</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;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#eee</span><span style="color: #00AA00;">;</span>
   box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">1px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.3</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
   -moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">1px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.3</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
   -webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">1px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.3</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
   <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.image-box</span> img <span style="color: #00AA00;">&#123;</span> 
   transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>15deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
   -moz-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>15deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
   -webkit-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>15deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</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;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50%</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50%</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-100px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">-150px</span><span style="color: #00AA00;">;</span>
   <span style="color: #00AA00;">&#125;</span></pre></div></td></tr></table></div>

<div class="image-box4">
   <img src="http://bavotasan.com/wp-content/uploads/2011/08/camera.jpg" alt="" width="300" height="200" />
</div>
<p>With CSS3 you no longer need to rely on something like Photoshop to get certain effects on your images. All it takes is a few lines of CSS3.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2011/rotated-images-with-css3/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Circular Images with CSS3</title>
		<link>http://bavotasan.com/2011/circular-images-with-css3/</link>
		<comments>http://bavotasan.com/2011/circular-images-with-css3/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 18:47:18 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[circle]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[round corner]]></category>
		<category><![CDATA[rounded corners]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=3133</guid>
		<description><![CDATA[I discovered how to create circular images using CSS3 the other day and thought it was totally awesome. The only drawback is that the image has to appear as a background image. You can&#8217;t really do this effect directly to an image that is displayed using an image tag. What this means is that no [...]]]></description>
			<content:encoded><![CDATA[<p>I discovered how to create circular images using CSS3 the other day and thought it was totally awesome. The only drawback is that the image has to appear as a background image. You can&#8217;t really do this effect directly to an image that is displayed using an image tag. What this means is that no one will be able to actually click and drag the image onto their desktop, but that might be totally okay with you.</p>
<p>First the HTML:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;circular&quot;</span><span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>Not much to it. Next comes the CSS:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.circular</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>
	border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
	-webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
	-moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">http://link-to-your/image.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span></pre></div></td></tr></table></div>

<p>A complete circle requires your border radius to be half of your width/height. Put it all together and your image will now look like this in Firefox, Safari and Chrome:</p>
<div class="circular"></div>
<p>You can even add a border or a shadow.</p>
<div class="circular shadow"></div>
<p>I added a black shadow with an opacity of 80% to achieve the effect above. The CSS looks something like this:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.circular</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>
	border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
	-webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
	-moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">http://link-to-your/image.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
	box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">8px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> .8<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	-webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">8px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> .8<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	-moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">8px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> .8<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span></pre></div></td></tr></table></div>

<p>There is an actual workaround for those who want to allow people to drag the image onto their desktop, but it requires a bit more HTML and CSS.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;circular&quot;</span><span style="color: #339933;">&gt;&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://link-to-your/image.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #339933;">/&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>


<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.circular</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>
	border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
	-webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
	-moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">http://link-to-your/image.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.circular</span> img <span style="color: #00AA00;">&#123;</span>
	opacity<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	filter<span style="color: #00AA00;">:</span> alpha<span style="color: #00AA00;">&#40;</span>opacity<span style="color: #00AA00;">=</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span></pre></div></td></tr></table></div>

<p>Using the CSS above, you now allow users to drag the image to their desktop. Try it below.</p>
<div class="circular"><img src="http://bavotasan.com/wp-content/uploads/2011/02/desktop.jpg" alt="" /></div>
<p>You won&#8217;t actually see the image being dragged across the browser but it will appear on your desktop once you drop it there.</p>
<p>You can also just add rounded corners with the CSS above by lowering the radius of the curve from 150px to anything you want.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2011/circular-images-with-css3/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Optimization Tips to Speed Up Your Site</title>
		<link>http://bavotasan.com/2010/optimization-tips-speed-up-site/</link>
		<comments>http://bavotasan.com/2010/optimization-tips-speed-up-site/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 21:14:56 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[speed]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=2682</guid>
		<description><![CDATA[Ever since Google announced that a site&#8217;s speed would be a major factor in its ranking, I have really been paying attention to how my site performs. I guess I should have been doing it anyway, but I am the type of person that sometimes needs a kick in the butt to realize what he [...]]]></description>
			<content:encoded><![CDATA[<p>Ever since <a href="http://googlewebmastercentral.blogspot.com/2010/04/using-site-speed-in-web-search-ranking.html">Google announced</a> that a site&#8217;s speed would be a major factor in its ranking, I have really been paying attention to how my site performs. I guess I should have been doing it anyway, but I am the type of person that sometimes needs a kick in the butt to realize what he should be doing. Now I keep an eye on my site and constantly monitor how it&#8217;s performing. That&#8217;s the only way to stay on top of things and guarantee that your visitors have a positive experience on your site.</p>
<p>Many things factor in to how your site performs, including the speed of your server, the amount of traffic on your site, how your site is coded, if your site is static or dynamic, and the list goes on. If your site has not been optimized then you are really doing yourself a disservice, especially now that your page rank might rely on it.</p>
<p>If you have a WordPress site, there are some great plugins to help you out. I like to use <a href="http://wordpress.org/extend/plugins/wp-super-cache/">WP Super Cache</a> to get things started. It is pretty easy to set up and works exceptionally well. Plus, the customer support is top notch, so if you have any issues you can just contact the author.</p>
<p>If you don&#8217;t use WordPress, you can still follow some of the steps below to get your site performing at its best.</p>
<p>First, let&#8217;s take a look at some free tools that are available online that can analyze your site and let you know exactly where the problems lie:</p>
<h3>Pingdom Tools</h3>
<p><img src="http://bavotasan.com/wp-content/uploads/2010/08/pingdomtools.jpg" alt="Pingdom Tools" title="pingdomtools" width="550" height="160" class="alignleft size-full wp-image-2681" /><br />
Pingdom Tools will give you a breakdown of all the files that your site needs to load to render a page, and whether or not any of them is problematic. It can also save your tests so you can compare your site&#8217;s statistics against one another on different occasions.<br />
<a href="http://tools.pingdom.com/">http://tools.pingdom.com/</a></p>
<h3>Web Page Test</h3>
<p><img src="http://bavotasan.com/wp-content/uploads/2010/08/webpagetest.jpg" alt="Web Page Test" title="webpagetest" width="550" height="160" class="alignleft size-full wp-image-2686" /><br />
Web Page Test provides a similar service to Pingdom Tools, but the results are a lot more elaborate. The test takes a bit longer but it&#8217;s well worth the wait. Your site will be graded on 6 different aspects of its performance: KeepAlive Enabled, Compress Text, Compress Images, Cache Static Content, Combine CSS/JS Files and Use of CDN. Once you are graded, you will also see why your site might have failed each test.<br />
<a href="http://www.webpagetest.org/">http://www.webpagetest.org/</a></p>
<h3>Firebug &#038; YSlow</h3>
<p><img src="http://bavotasan.com/wp-content/uploads/2010/08/firebug.jpg" alt="Firebug for Firefox" title="firebug" width="550" height="160" class="alignleft size-full wp-image-2687" /><br />
If you have a Web site and you&#8217;re not aware of Firebug, you need to become aware of it immediately. It&#8217;s an amazing developer tool for Firefox that can make your life a hell of a lot easier. It offers tools such as an element inspector, CSS editor, and  process console. To get your site optimized, install YSlow from Yahoo and you will have all the tools you need to test your site and find its weaknesses.<br />
<a href="http://getfirebug.com/">http://getfirebug.com/</a><br />
<a href="http://developer.yahoo.com/yslow/">http://developer.yahoo.com/yslow/</a></p>
<p>Once you&#8217;ve tested your site and you know what the problems are, you can start to make a few changes to help increase your site&#8217;s performance, which will in turn give your visitors a better experience and show search engines that you mean business.</p>
<p>You probably already know these tips, but just in case you don&#8217;t, pay attention because they are the basis of how you can optimize your site:</p>
<h3>Optimize Images for the Web</h3>
<p>If you plan on uploading an image to your site, make sure you&#8217;re not uploading the original 5 x 7 that has a resolution of 300dpi. Why? Because it&#8217;s such a large file that it will definitely slow down your site, if not crash it. That&#8217;s why all images must be optimized for the Web. If you have Photoshop, or any image editing software, you&#8217;ll have the option to export your image for the Web. </p>
<p>What does that mean? Well, first of all, you should probably aim for 72dpi, which is pretty much the Web standard. That will help bring your file size down. You should also save your photos as JPGs with a quality of around 50-60%, and your graphics as GIFs with a color range dependent on the graphic itself. If your image has a transparent background which doesn&#8217;t look too good as a transparent GIF, then you might want to make it a transparent PNG. That does increase the size of the file, so keep that in mind.</p>
<p>If you want to really get fancy, you can put together a CSS sprite so that all of your graphics and images are merged together into one file. This brings down the number of elements that your site has to load, but it does require a bit more effort in regards to the CSS used. Here is a CSS sprite I use on <a href="http://bavotasan.com">bavotasan.com</a>:</p>
<p><img src="http://bavotasan.com/wp-content/themes/bavotasan-2010/images/sprite_bavotasan.png" alt="CSS Sprite or bavotasan.com" width="336" height="225" class="aligncenter"  /></p>
<p>If you don&#8217;t have any desktop software to optimize your images, you can always take advantage of <a href="http://www.smushit.com/ysmush.it/">Yahoo&#8217;s Smush.it</a>, which allows you to upload an image file and have it optimized and returned to you. If you have YSlow installed, then you also have Smush.it included on the tools tab.</p>
<h3>Put CSS at the Top &#038; JavaScript at the Bottom</h3>
<p>Placing your CSS at the top of your site makes sense, because you want to have your elements styled before they start to render. Placing JavaScript at the bottom also makes a lot of sense because you need your elements to render before they can be manipulated by your JavaScript. This has become a standard and should always be the way these files are included in your site.</p>
<h3>Reduce the Number of HTTP Requests</h3>
<p>An HTTP request occurs every time your site fetches a file that is required to render the page. So every image, every JS file and pretty much every element on your Web page requires an HTTP request. That&#8217;s why CSS sprites are a great idea. They reduce the number of times your site needs to fetch an image. Another great idea is combining your CSS files and your JavaScript files into one. So grab all of your site&#8217;s CSS (you can view it using Firebug), create one file and include it in your header. Same goes for your JavaScript files, but make sure you place the JS elements in the proper order or else they won&#8217;t work, eg. jQuery needs to load before you use any actual jQuery. And be sure to stick your JS file in your footer.</p>
<p>If you don&#8217;t plan on making any changes to your CSS or JS, you can even minify the files to make them as small as possible. There are many online resources to do this, but you also have everything you need if you already installed Firebug and YSlow. If you take a look at <a href="http://jquery.com/">http://jquery.com/</a>, you can see the difference between the minified version (24kb) and the development version (155kb). That&#8217;s a big difference.</p>
<h3>The Hard Stuff</h3>
<p>This is where things start to get a little more complicated. The following tips require a bit of knowledge of coding, or at least a willingness to attempt to do some things that you might not really understand.</p>
<h3>Configure your ETags</h3>
<p>According to <a href="http://en.wikipedia.org/wiki/HTTP_ETag">Wikipedia</a>, an ETag, or entity tag, &#8220;<em>is one of several mechanisms that HTTP provides for cache validation, and which allows a client to make conditional requests.</em>&#8221; If you don&#8217;t plan on using them, which most likely you won&#8217;t, then you need to remove them completely by adding the following to your <code>.htaccess</code> file.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;">FileETag none</pre></div></td></tr></table></div>

<p>If you don&#8217;t have an <code>.htaccess</code> file in your site&#8217;s root directory, then create one and upload it because you&#8217;re going to have to make a few modifications to it to get your site optimized.</p>
<h3>Add Expires Headers</h3>
<p>Expires headers will let everyone know that certain elements can be cached by the browser so they won&#8217;t need to be reloaded every time a visitor hits your site. Static elements should have a far future expiration date and dynamic elements need to be configured according to how you plan on using them. The following will add an expiration date of one month to all your image, CSS and JS files.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Expire images header
</span>ExpiresActive On
ExpiresDefault A0
ExpiresByType image<span style="color: #339933;">/</span>gif A2592000
ExpiresByType image<span style="color: #339933;">/</span>png A2592000
ExpiresByType image<span style="color: #339933;">/</span>jpg A2592000
ExpiresByType image<span style="color: #339933;">/</span>jpeg A2592000
ExpiresByType image<span style="color: #339933;">/</span>ico A2592000
ExpiresByType text<span style="color: #339933;">/</span>css A2592000
ExpiresByType text<span style="color: #339933;">/</span>javascript A2592000</pre></div></td></tr></table></div>

<p>A2592000 (60*60*24*30) is a timestamp that equals one month. Remember, if you plan on modifying any files that have been cached with a future expiration date, you  need to rename them or else visitors will not see the changes until they clear their browser cache or the old files expire.</p>
<h3>Compress Components</h3>
<p>Compressing things always ends up making them smaller and load faster, so implementing some form of compression on your components is a must. This optimization step might not work for you if your server does not have either mod_deflate or mod_gzip installed as part of Apache. You should contact your service provider and inquire about this to find out which of the following codes you should use.</p>
<p>mod_deflate:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>FilesMatch <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>.(js|css|html|htm|php|xml)$&quot;</span><span style="color: #339933;">&gt;</span>
SetOutputFilter DEFLATE
<span style="color: #339933;">&lt;/</span>FilesMatch<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>mod_gzip</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>IfModule mod_gzip<span style="color: #339933;">.</span>c<span style="color: #339933;">&gt;</span>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include <span style="color: #990000;">file</span> \<span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span>html?<span style="color: #339933;">|</span>txt<span style="color: #339933;">|</span>css<span style="color: #339933;">|</span>js<span style="color: #339933;">|</span>php<span style="color: #339933;">|</span>pl<span style="color: #009900;">&#41;</span>$
mod_gzip_item_include handler ^cgi<span style="color: #339933;">-</span>script$
mod_gzip_item_include mime ^text<span style="color: #339933;">/.*</span>
mod_gzip_item_include mime ^application<span style="color: #339933;">/</span>x<span style="color: #339933;">-</span>javascript<span style="color: #339933;">.*</span>
mod_gzip_item_exclude mime ^image<span style="color: #339933;">/.*</span>
mod_gzip_item_exclude rspheader ^Content<span style="color: #339933;">-</span>Encoding<span style="color: #339933;">:.*</span>gzip<span style="color: #339933;">.*</span>
<span style="color: #339933;">&lt;/</span>IfModule<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<h3>Content Delivery Network</h3>
<p>It&#8217;s a little hard to believe, but the closer your visitor is to your server&#8217;s location, the faster they will receive your site elements. That&#8217;s where a CDN can come in handy. They provide multiple server locations for your site elements that will be accessed accordingly depending on where you visitors are located. This has been known to improve your site&#8217;s response time by up to 20%. The only problem, is it might cost you an arm and a leg to get it up and running. There are many CDNs popping up that are not as expensive as others, but to tell you the truth, this might not be a viable option unless your site is really bringing in the money, which in turn would make it worth having a CDN on your side.</p>
<h3>Conclusion</h3>
<p>When it comes down to it, running a successful Web site requires a lot of attention to certain things that you might never have considered. Being aware of optimization tools and techniques will definitely help you improve your site&#8217;s performance. Most importantly, it will get your site ready to be indexed by Google, Yahoo and many other search engines that rely on speed as a ranking factor.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/optimization-tips-speed-up-site/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Using jQuery for a Simple Animated Fade Effect</title>
		<link>http://bavotasan.com/2010/jquery-simple-animated-fade-effect/</link>
		<comments>http://bavotasan.com/2010/jquery-simple-animated-fade-effect/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 19:57:26 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[animate]]></category>
		<category><![CDATA[call]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[document]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[hover]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[Images]]></category>
		<category><![CDATA[img]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[opacity]]></category>
		<category><![CDATA[person]]></category>
		<category><![CDATA[piece]]></category>
		<category><![CDATA[selector]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=1817</guid>
		<description><![CDATA[I know I have already done a fade effect between two images with jQuery, but here is a quick little piece of code that will just add a nice animated fade effect to single images. Whenever a person hovers over an image, we will use jQuery to lower the opacity to make it appear lighter. [...]]]></description>
			<content:encoded><![CDATA[<p>I know I have already done a fade effect between two images with jQuery, but here is a quick little piece of code that will just add a nice animated fade effect to single images. Whenever a person hovers over an image, we will use jQuery to lower the opacity to make it appear lighter. Easy and not that impressive but still pretty cool.<br />
<span id="more-1817"></span><br />
Make sure you first call jQuery.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">'text/javascript'</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">'jquery.js'</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>Then just add the following code and all your images will have a slight fade when you hover over them.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;img&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;0.8&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>If you only want this to occur on certain images than just make sure to change the first jQuery selector to the class name of the images your want this effect to affect.</p>
<p>Try it out below:</p>
<p><script type="text/javascript">
  jQuery(document).ready(function(){
    jQuery("img.opacity").hover(function() {
      jQuery(this).stop().animate({opacity: "0.8"}, 'slow');
    },
    function() {
      jQuery(this).stop().animate({opacity: "1"}, 'slow');
    });
  });
</script></p>
<p><img src="http://bavotasan.com/wp-content/uploads/2009/09/jquerylogo.png" alt="" title="" width="200" height="150" class="alignleft opacity" /><img src="http://bavotasan.com/wp-content/uploads/2009/07/jquery.png" title="" alt="" width="200" height="150" class="alignleft opacity" /></p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/jquery-simple-animated-fade-effect/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>WordPress 2.9 is Out!</title>
		<link>http://bavotasan.com/2009/wordpress-2-9-is-out/</link>
		<comments>http://bavotasan.com/2009/wordpress-2-9-is-out/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 16:32:49 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[bunch]]></category>
		<category><![CDATA[chance]]></category>
		<category><![CDATA[compatibility]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[feature]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[New Features]]></category>
		<category><![CDATA[org]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=1597</guid>
		<description><![CDATA[I haven&#8217;t had a chance to go through WordPress 2.9 and figure out all the improvements just yet, but I am excited to do so. A few items they have been boasting about are a global undo/”trash” feature, a built-in image editor, a batch plugin update/compatibility checking and easier video embeds. Here is a little [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t had a chance to go through WordPress 2.9 and figure out all the improvements just yet, but I am excited to do so. A few items they have been boasting about are a global undo/”trash” feature, a built-in image editor, a batch plugin update/compatibility checking and easier video embeds.<br />
<span id="more-1597"></span><br />
Here is a little video from WordPress.org that goes through a bunch of the new features in 2.9.</p>
<p><embed src="http://v.wordpress.com/wp-content/plugins/video/flvplayer.swf?ver=1.11" type="application/x-shockwave-flash" width="580" height="326" allowscriptaccess="always" allowfullscreen="true" flashvars="guid=NBZ853Xn&amp;width=580&amp;height=326" title="Introducing WordPress 2.9 Carmen"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/wordpress-2-9-is-out/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using PHP to Remove an HTML Tag from a String</title>
		<link>http://bavotasan.com/2009/using-php-to-remove-an-html-tag-from-a-string/</link>
		<comments>http://bavotasan.com/2009/using-php-to-remove-an-html-tag-from-a-string/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 21:54:49 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[Image Tag]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Php Function]]></category>
		<category><![CDATA[piece]]></category>
		<category><![CDATA[Preg]]></category>
		<category><![CDATA[Remove]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[tag]]></category>
		<category><![CDATA[way]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=1555</guid>
		<description><![CDATA[There are times when you need to strip one specific HTML tag from a string and the PHP function strip_tags() doesn&#8217;t work the way you want it to. strip_tags() allows for certain exclusions, but why would you use that when you only want to exclude one tag and include all other tags? Especially when you [...]]]></description>
			<content:encoded><![CDATA[<p>There are times when you need to strip one specific HTML tag from a string and the PHP function <code>strip_tags()</code> doesn&#8217;t work the way you want it to.  <code>strip_tags()</code> allows for certain exclusions, but why would you use that when you only want to exclude one tag and include all other tags? Especially when you can use <code>preg_replace()</code>.<br />
<span id="more-1555"></span><br />
Here is a quick little piece of code that can be modified for any specific HTML tag you want to remove from a string. I am using it below to remove an image tag.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Here is your content with an image tag &lt;img src=&quot;http://bavotasan.com/wp-content/themes/bavotasan_new/images/bavota.png&quot; alt=&quot;Image&quot; /&gt;'</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/&lt;img[^&gt;]+\&gt;/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$string</span> <span style="color: #666666; font-style: italic;">// will output &quot;Here is your content with an image tag&quot; without the image tag</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></td></tr></table></div>

<p>You can replace the <code>img</code> in the <code>preg_replace()</code> function for it to work with whichever HTML tag you wish.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/using-php-to-remove-an-html-tag-from-a-string/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Discover and Create Great Color Palettes with Adobe&#8217;s Kuler</title>
		<link>http://bavotasan.com/2009/discover-and-create-great-color-palettes-with-adobes-kuler/</link>
		<comments>http://bavotasan.com/2009/discover-and-create-great-color-palettes-with-adobes-kuler/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 21:19:58 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[dashboard widget]]></category>
		<category><![CDATA[designer]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Tool]]></category>
		<category><![CDATA[Widgets]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=1176</guid>
		<description><![CDATA[Whether you pronounce it &#8220;kuh-ler&#8221; or &#8220;koo-ler&#8220;, Adobe&#8217;s color palette creation tool Kuler is a must for any designer. You can choose from thousands of color themes or even start from scratch and create your own. Got a colorful image you love? Kuler allows you to upload it and select a group of colors based [...]]]></description>
			<content:encoded><![CDATA[<p><a class="highslide" href="http://bavotasan.com/wp-content/uploads/2009/09/kuler.jpg"><img src="http://bavotasan.com/wp-content/uploads/2009/09/kuler-570x369.jpg" alt="kuler" title="kuler" width="570" height="369" class="aligncenter size-medium wp-image-1178" /></a>Whether you pronounce it &#8220;<em>kuh-ler</em>&#8221; or &#8220;<em>koo-ler</em>&#8220;, Adobe&#8217;s color palette creation tool <a href="http://kuler.adobe.com" target="_blank">Kuler</a> is a must for any designer. You can choose from thousands of color themes or even start from scratch and create your own. <span id="more-1176"></span>Got a colorful image you love? <a href="http://kuler.adobe.com" target="_blank">Kuler</a> allows you to upload it and select a group of colors based on the image&#8217;s &#8220;mood&#8221;. Once you find or create something you like, you can download the theme as an Adobe color palette or copy and paste the hex values to use however you choose.</p>
<p>If heading to the site is too much work for you, most of CS4 has a <a href="http://kuler.adobe.com" target="_blank">Kuler</a> panel built right into the software. There is even an <a href="http://www.adobe.com/go/kuler_air">Adobe Air desktop app</a> available and a <a href="http://kuler.adobe.com/links/download.cfm?linkURL=http://download.macromedia.com/pub/labs/kuler/kulerWidget.zip&#038;linkFile=kulerWidget.zip">Dashboard widget</a> for those who work on a Mac.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/discover-and-create-great-color-palettes-with-adobes-kuler/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>8 Free Colorful Background Textures for Designers</title>
		<link>http://bavotasan.com/2009/8-free-colorful-background-textures-for-designers/</link>
		<comments>http://bavotasan.com/2009/8-free-colorful-background-textures-for-designers/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 17:16:49 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Downloads]]></category>
		<category><![CDATA[Background]]></category>
		<category><![CDATA[Black]]></category>
		<category><![CDATA[Blue]]></category>
		<category><![CDATA[collection]]></category>
		<category><![CDATA[Colors]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[Images]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[Red]]></category>
		<category><![CDATA[site]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=1123</guid>
		<description><![CDATA[Background textures are great when it comes to designing for the web. They can be used for site backgrounds, as overlays for images or whatever else your heart may desire. I decided to put together a colorful collection of 8 different textures in case anyone is in need. If you don&#8217;t like the colors, you [...]]]></description>
			<content:encoded><![CDATA[<p>Background textures are great when it comes to designing for the web. They can be used for site backgrounds, as overlays for images or whatever else your heart may desire. I decided to put together a colorful collection of 8 different textures in case anyone is in need.<br />
<span id="more-1123"></span><br />
If you don&#8217;t like the colors, you can easily change them with Photoshop by going to Image => Adjustments => Hue/Saturation.</p>
<div id="attachment_1124" class="wp-caption aligncenter" style="width: 560px"><a class="highslide" href="http://bavotasan.com/wp-content/uploads/2009/09/blue.jpg"><img src="http://bavotasan.com/wp-content/uploads/2009/09/blue-570x400.jpg" alt="Blue Diamonds" title="blue" width="550" class="size-medium wp-image-1124" /></a><p class="wp-caption-text">Blue Diamonds</p></div>
<div id="attachment_1126" class="wp-caption aligncenter" style="width: 560px"><a class="highslide" href="http://bavotasan.com/wp-content/uploads/2009/09/brown.jpg"><img src="http://bavotasan.com/wp-content/uploads/2009/09/brown-570x400.jpg" alt="Brown Scuffed" title="brown" width="550" class="size-medium wp-image-1126" /></a><p class="wp-caption-text">Brown Scuffed</p></div>
<div id="attachment_1132" class="wp-caption aligncenter" style="width: 560px"><a class="highslide" href="http://bavotasan.com/wp-content/uploads/2009/09/red.jpg"><img src="http://bavotasan.com/wp-content/uploads/2009/09/red-570x400.jpg" alt="Red Bubbles" title="red" width="550" class="size-medium wp-image-1132" /></a><p class="wp-caption-text">Red Bubbles</p></div>
<div id="attachment_1127" class="wp-caption aligncenter" style="width: 560px"><a class="highslide" href="http://bavotasan.com/wp-content/uploads/2009/09/black.jpg"><img src="http://bavotasan.com/wp-content/uploads/2009/09/black-570x400.jpg" alt="Black Corrode" title="black" width="550" class="size-medium wp-image-1127" /></a><p class="wp-caption-text">Black Corroded</p></div>
<div id="attachment_1129" class="wp-caption aligncenter" style="width: 560px"><a class="highslide" href="http://bavotasan.com/wp-content/uploads/2009/09/green.jpg"><img src="http://bavotasan.com/wp-content/uploads/2009/09/green-570x400.jpg" alt="Green Circuits" title="green" width="550" class="size-medium wp-image-1129" /></a><p class="wp-caption-text">Green Circuits</p></div>
<div id="attachment_1133" class="wp-caption aligncenter" style="width: 560px"><a class="highslide" href="http://bavotasan.com/wp-content/uploads/2009/09/orange.jpg"><img src="http://bavotasan.com/wp-content/uploads/2009/09/orange-570x400.jpg" alt="Orange Mosaic" title="orange" width="550" class="size-medium wp-image-1133" /></a><p class="wp-caption-text">Orange Mosaic</p></div>
<div id="attachment_1130" class="wp-caption aligncenter" style="width: 560px"><a class="highslide" href="http://bavotasan.com/wp-content/uploads/2009/09/purple.jpg"><img src="http://bavotasan.com/wp-content/uploads/2009/09/purple-570x400.jpg" alt="Purple Aged" title="purple" width="550" class="size-medium wp-image-1130" /></a><p class="wp-caption-text">Purple Aged</p></div>
<div id="attachment_1131" class="wp-caption aligncenter" style="width: 560px"><a class="highslide" href="http://bavotasan.com/wp-content/uploads/2009/09/yellow.jpg"><img src="http://bavotasan.com/wp-content/uploads/2009/09/yellow-570x400.jpg" alt="Yellow Crumpled" title="yellow" width="550" class="size-medium wp-image-1131" /></a><p class="wp-caption-text">Yellow Crumpled</p></div>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/8-free-colorful-background-textures-for-designers/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Turn Text into an Image using the PHP GD Library</title>
		<link>http://bavotasan.com/2009/turn-text-into-an-image-using-the-php-gd-library/</link>
		<comments>http://bavotasan.com/2009/turn-text-into-an-image-using-the-php-gd-library/#comments</comments>
		<pubDate>Mon, 25 May 2009 20:56:41 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[Clue]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[Image Tag]]></category>
		<category><![CDATA[Images]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[Open]]></category>
		<category><![CDATA[Png]]></category>
		<category><![CDATA[something]]></category>
		<category><![CDATA[support]]></category>
		<category><![CDATA[tag]]></category>
		<category><![CDATA[text elements]]></category>
		<category><![CDATA[way]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=595</guid>
		<description><![CDATA[While developing a site for a client, I needed to figure out a way to convert certain text elements into images. I had no clue how to do this but after doing a bit of research, I discovered a nifty library of functions already available through PHP. The GD library offers tons of cools way [...]]]></description>
			<content:encoded><![CDATA[<p>While developing a site for a client, I needed to figure out a way to convert certain text elements into images. I had no clue how to do this but after doing a bit of research, I discovered a nifty library of functions already available through PHP. The GD library offers tons of cools way to dynamically create PNG, JPEG or GIF files and output them directly to your browser, but you need to make sure that your server has the library enabled.</p>
<p>You can check to see if the GD library available on your server by placing the code:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">phpinfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></td></tr></table></div>

<p>into a test.php file and uploading it to your site&#8217;s main directory. Open the file online and look to see if GD Support is Enabled. If it is, you are good to go.<br />
<span id="more-595"></span><br />
The following code will dynamically create a PNG file from a text string.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-type: image/png&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;This is my test string.&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$font</span>  <span style="color: #339933;">=</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$width</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">imagefontwidth</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$font</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$height</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagefontheight</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$font</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$image</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagecreatetruecolor</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$width</span><span style="color: #339933;">,</span><span style="color: #000088;">$height</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$white</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagecolorallocate</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$image</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">255</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">255</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">255</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$black</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagecolorallocate</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$image</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagefill</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$image</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #000088;">$white</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">imagestring</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$image</span><span style="color: #339933;">,</span><span style="color: #000088;">$font</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #000088;">$string</span><span style="color: #339933;">,</span><span style="color: #000088;">$black</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">imagepng</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$image</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagedestroy</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$image</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></td></tr></table></div>

<p>The above code must be included in its own file, it cannot be added to an existing PHP file with other functions. To access this image from another file just include it as the source in an image tag.</p>
<p>Test out turning text into an image by typing in something below.</p>
<form method="get" action="http://bavotasan.com/text-to-image.php">
<input type="text" name="text" maxlength="40" size="40" />
<input type="submit" name="submit" value="Text to Image" />
</form>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/turn-text-into-an-image-using-the-php-gd-library/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

