<?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>Fearless Flyer Web Design &#187; php</title> <atom:link href="http://fearlessflyer.com/tag/php/feed/" rel="self" type="application/rss+xml" /><link>http://fearlessflyer.com</link> <description>Fearless flyer is a blog that focuses on the latest topics of web design. This includes Wordpress, SEO, Photoshop, jQuery, PHP and CSS. Fearless flyer is owned and operated by Michael Soriano, a seasoned web developer living in Southern California.</description> <lastBuildDate>Mon, 23 Aug 2010 15:55:50 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Create a Single Page Portfolio from Scratch – Part 3: jQuery and PHP</title><link>http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/</link> <comments>http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/#comments</comments> <pubDate>Fri, 23 Apr 2010 02:40:16 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[Design]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[php]]></category><guid isPermaLink="false">http://fearlessflyer.com/?p=1369</guid> <description><![CDATA[Finally, we have come to the conclusion of this 3 part series. This part focuses on user interactions and functionality of our portfolio. The upper sections of the page I will take you through inserting several plugins as well as custom jQuery code that will make our page alive. This includes a rotating slideshow, expanding [...]]]></description> <content:encoded><![CDATA[<p>Finally, we have come to the conclusion of this 3 part series. This part focuses on user interactions and functionality of our portfolio. The upper sections of the page I will take you through inserting several plugins as well as custom jQuery code that will make our page alive. This includes a rotating slideshow, expanding and hiding sections and a modal view of images – also known as a “<strong>lightbox</strong>” effect. And to wrap it all up, we will add a small PHP snippet into our footer so we will have a working contact form.</p><div class="viewdemo"> <a href="http://demo.fearlessflyer.com/html/demo/one/">View the Demo:</a></div><div class="special"> This tutorial is part 3 of three parts: 1) <strong><a href="http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/">the Photoshop Mock up</a></strong>, 2) <strong><a href="http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/">Coding the HTML / CSS</a></strong> and finally 3) <strong><a href="http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/">Adding PHP / jQuery</a>.</strong></div><p>Are you ready to get your hands dirty? Let’s start coding:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/part3.jpg" alt="" title="Part 3 of 3" width="576" height="189" class="alignnone size-full wp-image-1370" style="border:0;" /></p><h3>Convert the Feature into a jQuery Powered Slideshow:</h3><p>Our feature section looks good as it is. Though it would be better if the large image on the right would change and cycle through other images. In other words, we need to convert it into a slideshow of our best work.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp1.jpg" alt="" title="Well convert this into a slideshow" width="576" height="323" class="alignnone size-full wp-image-1371" /></p><h4>Adding the Script Files</h4><p>First thing we need to do is download jQuery. jQuery will be powering all of the javascript we’re using for our page. Head on to <a href="http://jquery.com/">http://jquery.com/</a>, download and save it into our current directory.</p><p>Inside the head section of our HTML, insert our script tag:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script src=&quot;jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;</pre></div></div><p>Now all of jQuery’s magic is in our fingertips. Download the slideshow plugin from: <a href="http://jquery.malsup.com/cycle/">http://jquery.malsup.com/cycle/</a>. Right below our first script tag, insert directly below:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;script src=&quot;jquery.cycle.all.2.72.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
	$(document).ready(function(){
		//cycle plugin
		$('.slideshow').cycle({
			fx: 'fade' 
		});
&lt;/script&gt;</pre></td></tr></table></div><h4>Getting the images ready:</h4><p>Now that our scripts are intact, let’s get our images and our stylesheet ready so the animation will take place. Open <strong>feature.png</strong> in Photoshop and create new guides as shown below. Make sure you cut right down to the pixel.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp2.jpg" alt="" title="Add new guides" width="576" height="547" class="alignnone size-full wp-image-1372" /></p><p>Cut out the center image and fill with solid color.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp3.jpg" alt="" title="Fill with color" width="576" height="547" class="alignnone size-full wp-image-1373" /></p><p>Save the file under the same name.</p><p>Create several images that will go inside the slideshow -<strong> all must have the same dimensions</strong> &#8211; in our case: 476 pixels and 349 pixels.</p><p>Insert the HMTL right below the feature div. Of course you will replace the image names with your images, along with the right path:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;slideshow&quot;&gt;
&lt;img src=&quot;images/feature-1.jpg&quot;/&gt;
&lt;img src=&quot;images/feature-2.jpg&quot;/&gt;
&lt;img src=&quot;images/feature-3.jpg&quot;/&gt;
&lt;img src=&quot;images/feature-4.jpg&quot;/&gt;
&lt;img src=&quot;images/feature-5.jpg&quot;/&gt;		
&lt;/div&gt;</pre></td></tr></table></div><p>Append this code inside your existing style.css file:</p><div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#feature</span> <span style="color: #6666ff;">.slideshow</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</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;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">-24px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">21px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div><p>This ensures that the slideshow will sit on top of the designated box in the feature div:</p><p>Preview index.html in your browser. By now you should see your new slideshow swapping your images in your feature section:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp4.jpg" alt="" title="Our slideshow is in place" width="576" height="323" class="alignnone size-full wp-image-1374" /></p><p><strong>Next up: The expanding sections, and the “lightbox” effect.</strong></p><h3>Adding the “More” click events on the sections below the fold:</h3><p>We have two sections below the fold that showcase what our work is all about. One is the useful “<strong>Testimonials</strong>” section – where visitors read what others are saying about our services. And of course, the “<strong>Previous Work</strong>” area – where you plug in screenshots of work that you’ve done. This may be websites, photographs, software; anything that can be screen captured you can apply.</p><p>The point is to only show a few of testimonials, and a few thumbnails of your previous work. When visitors click on the “<strong>More</strong>” buttons, the section expands to show the rest.</p><p>This approach is also best for people who have plenty of work, but only would like to show a little at first.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp5.jpg" alt="" title="The More Buttons" width="576" height="630" class="alignnone size-full wp-image-1375" /></p><p>Insert the code below inside the <strong>$(document)</strong>.ready function:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.column:gt(2), #previous-work ul li:gt(3)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#testimonials&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div class='more'&gt;&lt;a id='more-testimonials'&gt;More Testimonials&lt;/a&gt;&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#previous-work&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div class='more'&gt;&lt;a id='more-previous-work'&gt;More Previous Work&lt;/a&gt;&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a#more-testimonials&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>		
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.column:gt(2)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;:hidden&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>							
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.column:gt(2)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a#more-testimonials&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Less Testimonials&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>				
			<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.column:gt(2)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a#more-testimonials&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;More Testimonials&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
			<span style="color: #009900;">&#125;</span>			
			event.<span style="color: #660066;">preventDefault</span><span style="color: #009900;">&#40;</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;">&#40;</span><span style="color: #3366CC;">&quot;a#more-previous-work&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>							
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#previous-work ul li:gt(3)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;:hidden&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#previous-work ul li:gt(3)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a#more-previous-work&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Less Previous Work&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>				
			<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#previous-work ul li:gt(3)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a#more-previous-work&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;More Previous Work&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>			
			event.<span style="color: #660066;">preventDefault</span><span style="color: #009900;">&#40;</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></pre></td></tr></table></div><p>The above code first hides our testimonial DIVS (that are greater than 3) and our previous work list items (that are greater than 4). Then it alters the HTML of our buttons, as well as toggle our hidden sections to appear while sliding slowly.</p><h3>Adding the light show effect for the Portfolio gallery:</h3><p>For the portfolio thumbnails &#8211; it would really be nice to add a “lightbox” effect once the images are clicked. Lightbox provide a way for viewers to see the detailed image without physically leaving the page. For our portfolio &#8211; we’re using <a href="http://fancybox.net/">http://fancybox.net/</a></p><p>Download: <a href="http://fancybox.googlecode.com/files/jquery.fancybox-1.2.6.zip">http://fancybox.googlecode.com/files/jquery.fancybox-1.2.6.zip</a><br /> Extract the files and copy the folder “<strong>fancybox</strong>” from the unzipped file and place in the root folder of our portfolio. Inside index.html, place the code in the head section:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;./fancybox/jquery.fancybox-1.2.6.pack.js&quot;&gt;&lt;/script&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;./fancybox/jquery.fancybox-1.2.6.css&quot; media=&quot;screen&quot; /&gt;</pre></td></tr></table></div><p>Inside our custom script tag, (right after the last “<strong>});</strong>”) insert the block of code:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a.zoom&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fancybox</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #3366CC;">'zoomSpeedIn'</span>	<span style="color: #339933;">:</span> <span style="color: #CC0000;">500</span><span style="color: #339933;">,</span>
			<span style="color: #3366CC;">'zoomSpeedOut'</span> <span style="color: #339933;">:</span> <span style="color: #CC0000;">500</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><p>In our unordered list of thumbnails, insert this “<strong>class</strong>” and “<strong>rel</strong>” attributes for each anchor tag:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">class=&quot;zoom&quot; rel=&quot;group&quot;</pre></div></div><p>Refresh <strong>index.html</strong> in your browser and click a thumbnail. You should now see the effects of Fancy box from your portfolio:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp-unknown.jpg" alt="" title="The lightbox effect" width="576" height="323" class="alignnone size-full wp-image-1377" /></p><p><strong>Last step: The contact form.</strong></p><h3>Completing the Contact Form with PHP</h3><p>Since HTML and javascript doesn’t support contents of a form to be sent through email, we need a little help from PHP to bring our contact form to life. We are now working with server side technology, so won’t be able to test our file without a web server. So in order to test our code, upload your file to your web host or run apache locally using <strong>WAMP</strong> or <strong>MAMP</strong>.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp6.jpg" alt="" title="Server side code needs a web server" width="576" height="400" class="alignnone size-full wp-image-1380" /></p><p>First thing we have to do is change the extension of <strong>index.html</strong> to <strong>.php</strong>. We will be working with the .php file from now on. You can discard the .html version – or keep it for archive.</p><p>Look for the form tag inside <strong>index.php</strong>; add a method and an action attribute:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;form id=&quot;contact-form&quot; method=&quot;post&quot; action=&quot;&quot;&gt;</pre></div></div><p>This enables our form to use the <strong>$_POST</strong> array and be processed by the same page. To test the contents of our post array, type the following code right above the form:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;pre&gt;
&lt;?php print_r($_POST) ?&gt;</pre></td></tr></table></div></pre><p>Now, add some stuff to the form fields, click “<strong>Submit</strong>” and see what our pre tags have spitted out:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp7.jpg" alt="" title="Contents of our post array" width="576" height="400" class="alignnone size-full wp-image-1381" /></p><p>Now we know what we need to work with as far as the contents of our post array. We can now remove the  pre tags and continue to work on our code. Add the following code on the very top of the page (even before the !DOCTYPE declaration):</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">//see number 1</span>
 <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">array_key_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'send'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">//see number 2</span>
<span style="color: #000088;">$to</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'youremail@mail.com'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//this is your email address</span>
	<span style="color: #000088;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'From Your Contact Form'</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$email</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> 
	<span style="color: #000088;">$comments</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'comments'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>  
		<span style="color: #666666; font-style: italic;">//see number 3</span>
<span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Name: <span style="color: #006699; font-weight: bold;">$name</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span> 
	<span style="color: #000088;">$message</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Email: <span style="color: #006699; font-weight: bold;">$email</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$message</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Comments: <span style="color: #006699; font-weight: bold;">$comments</span>&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">//see number 4</span>
	<span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div><p><strong>What the above code is doing: </strong></p><div class="one">checks to see if the “<strong>submit</strong>” button has been clicked by checking if an array key by the name of “send” exists. If it does, the rest of the code executes:</div><div class="two">we’re creating several variables that we can work with – this includes $to – email address to send to, along with the contents of the post array</div><div class="three">we’re compiling the message by concatenating the variables we’ve created</div><div class="four">finally, the “<strong>mail</strong>” function which is what allows you send mail</div><p>Now it’s time to test the code. Enter your email address into the <strong>$to</strong> variable then upload index.php to your web server. Fill out the form fields and click “<strong>submit</strong>”. You should receive an email similar to below:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp8.jpg" alt="" title="Sample Email" width="576" height="291" class="alignnone size-full wp-image-1382" /></p><p>Now remember <strong>that this is a stripped down version of a contact form</strong>. You should seriously consider adding several things such as form validation and formatting the entries for safe and legitimate values. Also add error and success messages to let the user know what’s going on. (I won’t cover such things because as you can see – this tutorial has gone waaay too long).</p><h3>Final Words</h3><p>There you have it - a complete single page portfolio. We started all the way from scratch: Mocked up the concept in Photoshop, hand coded the HTML, while slicing the images and writing the CSS. We've added some jQuery magic as well as a little bit of PHP functionality. As you see - a lot of work does go into it (and that's just a single page!)</p><p>In closing, I hope that you may learn something from this 3 part series. I also would like to thank the script and plugin developers which I included in this tutorial. You can <strong><a href="http://fearlessflyer.com/downloads/single-page-portfolio-final.zip">download the finished product from this link</a></strong>, and of course<strong><a href="http://demo.fearlessflyer.com/html/demo/one/"> view the live demo</a></strong> from here.</p><div class="special"> This tutorial is part 3 of three parts: 1) <strong><a href="http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/">the Photoshop Mock up</a></strong>, 2) <strong><a href="http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/">Coding the HTML / CSS</a></strong> and finally 3) <strong><a href="http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/">Adding PHP / jQuery</a>.</strong></div> ]]></content:encoded> <wfw:commentRss>http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Create a Single Page Portfolio from Scratch &#8211; Part 2: HTML and CSS</title><link>http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/</link> <comments>http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/#comments</comments> <pubDate>Sun, 13 Dec 2009 23:30:22 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[Websites]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[html]]></category> <category><![CDATA[Photoshop]]></category> <category><![CDATA[php]]></category> <category><![CDATA[single page portfolio]]></category> <category><![CDATA[tutorial]]></category><guid isPermaLink="false">http://fearlessflyer.com/?p=1035</guid> <description><![CDATA[Now we have come to part 2 of this series on how to create a single page portfolio from scratch. This part focuses on the HTML and CSS mark up to convert our .psd file to a living web page. The tools we need for this is of course &#8211; Photoshop, an HTML editor (in [...]]]></description> <content:encoded><![CDATA[<p>Now we have come to part 2 of this series on how to create a single page portfolio from scratch. This part focuses on the HTML and CSS mark up to convert our .psd file to a living web page. The tools we need for this is of course &#8211; Photoshop, an HTML editor (in my case I’m using Dreamweaver) and multiple browsers for page testing. We’re also going to toggle between these tools a lot so be prepared to switch programs by using alt + tab often.</p><div class="viewdemo"> <a href="http://demo.fearlessflyer.com/html/demo/one/">View the Demo:</a></div><div class="special"> This tutorial is part 2 of three parts: 1) <strong><a href="http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/">the Photoshop Mock up</a></strong>, 2) <strong><a href="http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/">Coding the HTML / CSS</a></strong> and finally 3) <strong><a href="http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/">Adding PHP / jQuery</a>.</strong></div><p>To preview what we are going to build &#8211; <strong><a href="http://fearlessflyer.com/main/wp-content/uploads/demo/one-page-portfolio/">see the demo page</a></strong>. Just in case you missed the first tutorial, click <strong><a href="http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/">here</a></strong>. So are you ready to get started? Let’s begin:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/part2.jpg" alt="part2" title="This is Part 2 of a 3 part series" width="576" height="189" class="alignnone size-full wp-image-1122" style="border:0;" /></p><h3>The Wrap, Header and Feature Divs</h3><p>First of all, you will notice that our layout doesn’t really have anything in the header. This is because I’m sure you will use your own logo for your design &#8211; so I left that out. Second, is there really is no need for a navigation bar because we’re only building a single page. Although we may include some anchors in this area so we can quickly jump from one section of the page to another. Also important to recognize that most modern websites now have a large “feature” section which packs the main message of the website. This effect is proven to be pretty effective &#8211; that’s why we’re applying the same concept to our portfolio site.</p><p>In Dreamweaver, create a new HTML page, name it “<strong>index.html</strong>” and save it.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp1.jpg" alt="sp1" title="New HTML document in Dreamweaver" width="576" height="478" class="alignnone size-full wp-image-1037" /></p><p>Create a CSS document &#8211; name it “<strong>styles.css</strong>” and save it in the same location as “index.html”. Link to the stylesheet from index.html by using a link tag:</p><div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;link type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span>  href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;styles.css&quot;</span> rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> /<span style="color: #00AA00;">&gt;</span></pre></div></div><p>Now, we create the main DIV &#8211; we’ll call this the “<strong>wrap</strong>”. In this DIV we’ll house almost all of our elements (all but one: the footer &#8211; which I’ll explain later). In index.html, enter the code:</p><div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;div id<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;wrap&quot;</span><span style="color: #00AA00;">&gt;</span>  &lt;/div<span style="color: #00AA00;">&gt;</span>&lt;!--wrap--<span style="color: #00AA00;">&gt;</span></pre></div></div><p>Next, we grab the body style of our page. Go to Photoshop and open our mockup. Flatten the image (“<strong>Layer</strong>” > “<strong>Flatten Image</strong>”) and grab a piece of background:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp2.jpg" alt="sp2" title="Grab a piece for the background" width="576" height="334" class="alignnone size-full wp-image-1038" /></p><p>Still in Photoshop, press Ctrl + C to copy the selected area, create a new document &#8211; and paste (this will be our HTML body background that will span horizontally). Save this file as “<strong>body-bg.gif</strong>” inside a folder called “<strong>images</strong>” in our root directory.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp3.jpg" alt="sp3" title="Save as body-bg.gif" width="576" height="478" class="alignnone size-full wp-image-1039" /></p><p>Next is we apply some fixin’s to our CSS:</p><div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #00AA00;">*</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">&#125;</span>
  body<span style="color: #00AA00;">&#123;</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;">images/body-bg.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-x</span> <span style="color: #cc00cc;">#f3f2ed</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div><p>The above code tells everything to reset to 0 padding and 0 margin. It also applies the body background to the image we just created, repeat it horizontally and apply the color #f3f2ed everywhere else. View your file in the browser, you should have something like below:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp4.jpg" alt="sp4" title="This is how our HTML looks so far" width="576" height="454" class="alignnone size-full wp-image-1040" /></p><p>Now remember we created the main div? That is just sitting in somewhere in the page. Let’s apply some standard measurements to it and align it so it settles perfectly in the middle of our browser.</p><p>Note that in the beginning of this tutorial &#8211; I was going to use the <strong>960.gs</strong> framework, but feel as though I’m cheating because the tutorial calls for “<strong>from scratch</strong>”. So I decided, I’m not using the framework and code everything by hand, hence &#8211; “<strong>from scratch</strong>”.</p><p>Add this code to your style.css:</p><div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#wrap</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">960px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#CCCCCC</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">min-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">500px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div><p>This centers our wrap in the middle of the page, as well as set the default 960 pixels width. The background color and the minimum height properties are added temporarily so we can tell from the browser what we’re working with. Refresh your page and you should have something like below:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp5.jpg" alt="sp5" title="Our Wrap DIV in gray background" width="576" height="349" class="alignnone size-full wp-image-1041" /></p><p>Go back to index.html and add the <strong>header </strong>div inside the wrap div:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div  id=&quot;header&quot;&gt;&lt;/div&gt;&lt;!--header--&gt;</pre></div></div><p>Back to our style.css &#8211; add this piece of code:</p><div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#header</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">32px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#333333</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div><p>Refresh your browser &#8211; and you can see where our header sits nicely on top. The background color again is temporary.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp6.jpg" alt="sp6" title="See the Header?" width="576" height="349" class="alignnone size-full wp-image-1042" /></p><p>Next is our feature div. Create a new div tag in your index.html with the id of “<strong>feature</strong>”, place in between the “feature” divs. Add two paragraph tags inside with your own text. In my case &#8211; I’m using the default Lorem latin filler text:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;feature&quot;&gt;
&lt;p id=&quot;slogan&quot;&gt;&lt;!--your fantastic slogan goes here--&gt;&lt;/p&gt;
&lt;p&gt;&lt;!--followed by a smaller, but also fantastic slogan here--&gt;&lt;/p&gt;
&lt;/div&gt;&lt;!--feature--&gt;</pre></td></tr></table></div><p>Notice the first paragraph tag has an id of “<strong>slogan</strong>”. This is because this is the primary text that we are going to style with an image. We are treating it as regular text for SEO purposes.</p><p>Go back to your mock up in Photoshop and press “<strong>Step Backward</strong>” (ctrl + z + alt) several times until you get the fully layered version once again. Make sure the guides are showing &#8211; select the feature section like below:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp7.jpg" alt="sp7" title="Grab our Feature Area in Photohsop" width="576" height="454" class="alignnone size-full wp-image-1043" /></p><p>In your layers panel, make sure you hide all the layers that shouldn’t be shown. This includes all the background layers and text elements. The only layer that should remain is the large feature image and the borders and glow to the left. Select the feature area and hit crop (“image” > “crop”). Save this as “<strong>feature.png</strong>” inside our images folder. This will be our feature div background image:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp8.jpg" alt="sp8" title="Save as feature.png" width="576" height="413" class="alignnone size-full wp-image-1044" /></p><p>Now in our styles.css &#8211; add the following code:</p><div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#feature</span> <span style="color: #00AA00;">&#123;</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;">images/feature.png</span><span style="color: #00AA00;">&#41;</span>  <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">394px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div><p>Go back to your mockup and click “<strong>Step Backward</strong>” (“Edit” > “Step Backward”) to uncrop. Unhide the slogan layer and select it according to the guides. Crop once again and save this as “<strong>slogan.png</strong>”.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp9.jpg" alt="sp9" title="Save as slogan.png" width="576" height="454" class="alignnone size-full wp-image-1045" /></p><p>Now add this code to your styles.css:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#feature</span> p<span style="color: #cc00cc;">#slogan</span> <span style="color: #00AA00;">&#123;</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;">images/slogan.png</span><span style="color: #00AA00;">&#41;</span>  <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">390px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">192px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-indent</span><span style="color: #00AA00;">:</span><span style="color: #933;">-9999px</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;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">30px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#feature</span> p <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span>verdana<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">320px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">48px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">28px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><p>The above code styles the two paragraph tags inside the feature div. The first one with a background image, and the next one as plain text. Now when search engines crawl our page &#8211; it still thinks both are plain text &#8211; which is a good thing.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp10.jpg" alt="sp10" title="Voila! Our HTML is coming along!" width="576" height="387" class="alignnone size-full wp-image-1046" /></p><p>I’ve also taken out the color property in our wrap div to see how our feature looks like. Another thing to remember is that since our feature sits in its own div &#8211; it will be easy to add a slideshow or something to that effect as replacement.</p><p>Now that our wrap, header and feature is in place, we’re ready to move to the next sections: <strong>Testimonials and Previous Work:</strong></p><h3>Testimonials and Previous Work Sections</h3><p>If the feature section is our hard hitter &#8211; a testimonials area is our “<strong>counter punch</strong>”. Testimonials are a sure fire way of telling our viewers: “<em>we’re good &#8211; read what others are saying about me!</em>”. Also another proven way of increasing business, it is also the reason why we’re putting testimonials right below our feature section. Ready to continue coding? Let’s keep going.</p><p>In our index.html, add the code for our testimonials. Place this directly below our feature div:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;column first&quot;&gt;
&lt;p&gt;&lt;!--your content here--&gt;&lt;/p&gt;&lt;strong&gt;&lt;!--author here--&gt;&lt;/strong&gt;
&lt;/div&gt;&lt;!--column--&gt;
&lt;div class=&quot;column&quot;&gt;
&lt;p&gt;&lt;!--your content here--&gt;&lt;/p&gt;&lt;strong&gt;&lt;!--author here--&gt;&lt;/strong&gt;
&lt;/div&gt;&lt;!--column--&gt;
&lt;div class=&quot;column last&quot;&gt;
&lt;p&gt;&lt;!--your content here--&gt;&lt;/p&gt;&lt;strong&gt;&lt;!--author here--&gt;&lt;/strong&gt;
&lt;/div&gt;&lt;!--column--&gt;
&lt;/div&gt;&lt;!--testimonials--&gt;</pre></td></tr></table></div><p>Of course, you substitute real testimonials and authors in its place. Notice the “first” and “last” additional classes to the columns &#8211; we need this to fix our margins in our css. Next, go back to Photoshop and go backwards again so you get back to the original uncropped file. Select the Testimonials title all the way to the rightmost guide. Crop and save as “<strong>testimonials-title.jpg</strong>” inside our images folder.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp11.jpg" alt="sp11" title="Our Headings Background - Testimonials" width="576" height="454" class="alignnone size-full wp-image-1047" /></p><p>Inside styles.css, append the below code:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#testimonials</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</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;">images/testimonials-title.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</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;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">65px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#testimonials</span> <span style="color: #6666ff;">.column</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;">260px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #3333ff;">:georgia</span><span style="color: #00AA00;">,</span> helvetica<span style="color: #00AA00;">,</span>  arial<span style="color: #00AA00;">,</span> <span style="color: #993333;">serif</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">13px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">19px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#testimonials</span> <span style="color: #6666ff;">.column</span><span style="color: #6666ff;">.first</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#testimonials</span> <span style="color: #6666ff;">.column</span><span style="color: #6666ff;">.last</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><p>This code adds the background image that we just created to the main testimonials div. It also adds proper styling to the columns inside the div, and fixes to the margins so it remains inside our imaginary grid.</p><p><strong>The optional “more” tab</strong></p><p>The more tab is only necessary if you have more than 3 columns of testimonials that you would like to show. The point is just show 3 columns at first, and by clicking the “<strong>more</strong>” tab &#8211; more testimonial columns will slide below &#8211; most likely to be achieved by jQuery (I haven’t gotten there yet &#8211; remember &#8211; I’m writing this tutorial as I go!).</p><p>To add a more tab &#8211; add this code to your HMTL, right underneath the last column div:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;more&quot;&gt;
&lt;a id=&quot;more-testimonials&quot;&gt;More  Testimonials&lt;/a&gt;
&lt;/div&gt;&lt;span id=&quot;more-1035&quot;&gt;&lt;/span&gt;</pre></td></tr></table></div><p>Note that we used a class for our div instead of an id. This is because this div can actually be reused in another section of our page.</p><p>Go back to your Photoshop file &#8211; click “<strong>Step Backwards</strong>” to the uncropped version &#8211; select the section that shows the “<strong>more testimonials</strong>” border and button according to your guides. Remember to hide the text layer over the button.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp12.jpg" alt="sp12" title="Our More Tab in the bottom of the section" width="576" height="454" class="alignnone size-full wp-image-1048" /></p><p>Crop and save this as “<strong>more-bg.jpg</strong>” inside the images folder. Add the code below to your .css file:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.more</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</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;">images/more-bg.jpg</span><span style="color: #00AA00;">&#41;</span>  <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">31px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.more</span> a<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span>verdana<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.more</span> a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#999999</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
a<span style="color: #cc00cc;">#more-testimonials</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span> <span style="color: #933;">16px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><p>For the “<strong>Previous Work</strong>” section &#8211; it’s pretty much the same process as testimonials. The difference is &#8211; we are actually using an unordered list instead of div columns. Add the following code inside your HTML:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;previous-work&quot;&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a  href=&quot;images/thumbnail.jpg&quot;&gt;&lt;img  src=&quot;images/thumbnail.jpg&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;images/thumbnail.jpg&quot;&gt;&lt;img  src=&quot;images/thumbnail.jpg&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a  href=&quot;images/thumbnail.jpg&quot;&gt;&lt;img  src=&quot;images/thumbnail.jpg&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;last&quot;&gt;&lt;a  href=&quot;images/thumbnail.jpg&quot;&gt;&lt;img  src=&quot;images/thumbnail.jpg&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;more&quot;&gt;
&lt;a id=&quot;more-previous-work&quot;&gt;More Previous  Work&lt;/a&gt;
&lt;/div&gt;&lt;!--more--&gt;
&lt;/div&gt;&lt;!--previous-work--&gt;</pre></td></tr></table></div><p>The thumbnail sizes are going to be 200 pixels width by152 pixels height. My sample code contains dummy thumbnails along with temporary images for the bigger image. We are incorporating a light box effect in the final product so users do not actually leave the page when viewing your gallery. Notice the addition of the “<strong>more</strong>” tab &#8211; which is again, purely optional.</p><p>For the “<strong>Previous Work</strong>” title &#8211; you do the same exact process in Photoshop as you did previously in the Testimonials title. Save this image in the images folder &#8211; name it: “<strong>previous-work-title.jpg</strong>”.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp13.jpg" alt="sp13" title="Our other Heading Image - Previous Work" width="576" height="454" class="alignnone size-full wp-image-1049" /></p><p>Now we add some styling to the list items, thumbnails and the entire div section:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#previous-work</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</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;">images/previous-work-title.jpg</span><span style="color: #00AA00;">&#41;</span>  <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</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;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">65px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">1px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#previous-work</span> ul <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">7px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#previous-work</span> ul li<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span> <span style="color: #933;">15px</span> <span style="color: #933;">20px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#previous-work</span> ul li<span style="color: #6666ff;">.last</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">20px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#previous-work</span> ul li a<span style="color: #00AA00;">&#123;</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;">images/thumb-bg.jpg</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">209px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">165px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">11px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#previous-work</span> ul li a<span style="color: #3333ff;">:hover  </span><span style="color: #00AA00;">&#123;</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;">images/thumb-bg-hover.jpg</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#previous-work</span> ul li a img <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
a<span style="color: #cc00cc;">#more-previous-work</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span> <span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><p>I also created a couple of thumbnail image backgrounds for the active and hover states. Again this is purely optional and I won’t go over in this tutorial.</p><p>Now refresh your page in your browser. You should have something like the image below. It is also good practice to start viewing your page in different browsers. This way &#8211; you can start fixing bugs this early in the development process. Next stop is the <strong>footer</strong>.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp14.jpg" alt="sp14" title="The fold and below the fold become unfolded" width="576" height="566" class="alignnone size-full wp-image-1050" /></p><h3>The Footer</h3><p>Let’s go back to our Photoshop file &#8211; you may have to go back in history a couple of times to get you to the uncropped, fully layered version. Another thing to remember is <strong>NOT</strong> to save your original mock up file. This file is to stay in its original form &#8211; we are just cropping, hiding layers as we go to get the parts we want. But in the whole, this mockup .psd file remains in its original state. Select the footer area &#8211; starting from the guide a few pixels above the dark brown area.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp15.jpg" alt="sp15" title="Our Footer in Photoshop" width="576" height="566" class="alignnone size-full wp-image-1051" /></p><p>Once selected &#8211; crop the selection &#8211; but don’t save as of yet; we’re going to save a couple of images from this selection &#8211; one is the footer wrap, the other is the actual footer background.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp16.jpg" alt="sp16" title="Grab a piece for our background" width="576" height="204" class="alignnone size-full wp-image-1052" /></p><p>Once cropped, select the first 20 pixels from the left and crop once again. Save this file as “<strong>footer-wrap.gif</strong>” inside our images folder. Now go back to the Photoshop file and step backwards a couple of times to bring us to entire cropped footer image. Hide the layer group named “<strong>form</strong>”, as well as all the text layers in the footer area.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp17.jpg" alt="sp17" title="Hide Layers and save as the main footer background" width="576" height="388" class="alignnone size-full wp-image-1053" /></p><p>Save this file as “<strong>footer.jpg</strong>” in the images folder. Unhide the text layer that says “Hire Me for Professional Work”, and hide all the background layers so you get full transparency. Select the text area using the rectangular marquee tool and crop. Save this file as “<strong>slogan2.png</strong>” in our images folder.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp18.jpg" alt="sp18" title="Our slogan as .png image" width="576" height="194" class="alignnone size-full wp-image-1054" /></p><p>Now hit “<strong>Step Backward</strong>” (ctrl + alt + z) a couple of times to get to the uncropped footer image and unhide the “<strong>form</strong>” group of layers. Make sure you hide all the layers inside the form &#8211; all we need is the rounded container that embodies the form. Select this area, crop and save this file as “<strong>form-bg.png</strong>” in our images folder.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp19.jpg" alt="sp19" title="Our Form background - save as form-bg.png" width="576" height="269" class="alignnone size-full wp-image-1055" /></p><p>Finally, unhide the button text, shape and glow. Create guides that surround the button image and select accordingly. Crop and save as “<strong>submit.png</strong>” in our images folder.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp20.jpg" alt="sp20" title="Thats one kick ass submit button!" width="576" height="192" class="alignnone size-full wp-image-1056" /></p><p>Now go back to our index.html, add the following code right underneath the entire wrap div.</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;footer-wrap&quot;&gt;
&lt;div id=&quot;footer&quot;&gt;
&lt;div id=&quot;left-container&quot;&gt;
&lt;p id=&quot;slogan2&quot;&gt;Hire Me for Professional  Work&lt;/p&gt;
&lt;p&gt;&lt;!--your footer slogan in this section&lt;/p&gt;
&lt;/div&gt;&lt;!--left-container--&gt;
&nbsp;
&lt;form id=&quot;contact-form&quot;&gt;
&nbsp;
&lt;div id=&quot;split-left&quot;&gt;
  &lt;label  for=&quot;name&quot;&gt;Name:&lt;/label&gt;&lt;br/&gt;
  &lt;input name=&quot;name&quot; id=&quot;name&quot;  type=&quot;text&quot; class=&quot;formbox&quot;/&gt;&lt;br /&gt;
  &lt;label  for=&quot;email&quot;&gt;Email:&lt;/label&gt;&lt;br /&gt;
  &lt;input name=&quot;email&quot; id=&quot;email&quot;  type=&quot;text&quot; class=&quot;formbox&quot; /&gt;&lt;br /&gt;
&lt;/div&gt;&lt;!--split-left--&gt;
  &lt;label  for=&quot;comments&quot;&gt;Comments:&lt;/label&gt;&lt;br /&gt;
  &lt;textarea name=&quot;comments&quot;  id=&quot;comments&quot; type=&quot;textarea&quot; class=&quot;formbox&quot;  /&gt;&lt;/textarea&gt;
  &lt;input name=&quot;send&quot; id=&quot;send&quot;  type=&quot;submit&quot; value=&quot;&quot; class=&quot;send&quot;  /&gt;
&lt;/form&gt;
&nbsp;
&lt;/div&gt;&lt;!--footer--&gt;
&lt;/div&gt;&lt;!--footer-wrap--&gt;</pre></td></tr></table></div><p>The above code sets up all the content in the footer. This includes the two paragraphs on the left side and the contact form. Note that the form is still static. We will be converting this into a working form once we convert this to PHP.</p><p>Next up, is to style the contact form. Add the following code to your styles.css:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#footer-wrap</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</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;">images/footer-wrap.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-x</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">377px</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;">20px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#footer</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;">940px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</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;">images/footer.jpg</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">377px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#footer</span> <span style="color: #cc00cc;">#left-container</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;">400px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#contact-form</span> <span style="color: #00AA00;">&#123;</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;">images/form-bg.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">427px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">169px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">40px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">78px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#split-left</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;">170px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">30px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#contact-form</span> label<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#9e876b</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span>verdana<span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#contact-form</span> <span style="color: #6666ff;">.formbox</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">4px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">7px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
input<span style="color: #6666ff;">.send</span> <span style="color: #00AA00;">&#123;</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;">images/submit.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">101px</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">37px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</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;">10px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
input<span style="color: #3333ff;">:hover</span><span style="color: #6666ff;">.send</span> <span style="color: #00AA00;">&#123;</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>images/submit2.png<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><p>The above code sets up our footer wrap to span the entire width of the page with its own background image repeating horizontally. Now you understand why we excluded this from the main wrap div? The rest of the code applies the styling to the footer and contact form &#8211; tied to the images we created in the previous steps.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp21.jpg" alt="sp21" title="With all the form elements in place - it looks like a form!" width="576" height="252" class="alignnone size-full wp-image-1057" /></p><p>Finally, we add the final touches to the two paragraph tags on the left side. Add this code to your styles.css:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#footer</span> p<span style="color: #cc00cc;">#slogan2</span> <span style="color: #00AA00;">&#123;</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>images/slogan2.png<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">400px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">123px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-indent</span><span style="color: #00AA00;">:</span><span style="color: #933;">-9999px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#footer</span> p <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">400px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span>verdana<span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">1px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp22.jpg" alt="sp22" title="Our SEO aware slogan and mini slogan" width="576" height="252" class="alignnone size-full wp-image-1036" /></p><p>That concludes are HTML and CSS tutorial on our single page portfolio. Remember, we still have the scripting side to do &#8211; which is handled by PHP and jQuery, which we&#8217;ll cover in the next series. <strong><a href="http://fearlessflyer.com/main/wp-content/uploads/demo/one-page-portfolio/">Click Here to see the DEMO Version</a></strong> of what we just created. The <strong><a href="http://fearlessflyer.com/downloads/Single-Page-Portfolio-HTML.zip">source code is also available to download</a></strong> &#8211; which includes all the files covered in this tutorial.</p><div class="special"> This tutorial is part 2 of three parts: 1) <strong><a href="http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/">the Photoshop Mock up</a></strong>, 2) <strong><a href="http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/">Coding the HTML / CSS</a></strong> and finally 3) <strong><a href="http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/">Adding PHP / jQuery</a>.</strong></div> ]]></content:encoded> <wfw:commentRss>http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Create a Single Page Portfolio from Scratch &#8211; Part 1: Photoshop Mockup</title><link>http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/</link> <comments>http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/#comments</comments> <pubDate>Wed, 11 Nov 2009 07:20:47 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[HTML and PSD]]></category> <category><![CDATA[Photoshop]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[php]]></category> <category><![CDATA[portfolio]]></category> <category><![CDATA[shiny]]></category> <category><![CDATA[Single column]]></category> <category><![CDATA[Single page]]></category> <category><![CDATA[Sleek]]></category> <category><![CDATA[Static]]></category> <category><![CDATA[Web 2.0]]></category><guid isPermaLink="false">http://fearlessflyer.com/?p=899</guid> <description><![CDATA[Ahhh &#8211; so many choices when it comes to what open source software to use: Joomla, WordPress, Drupal&#8230;but aren’t they at times &#8211; a little overkill? For smaller web designers like myself, I still get the usual client who just wants a simple website to advertise their services. Most of the time they will have [...]]]></description> <content:encoded><![CDATA[<p>Ahhh &#8211; so many choices when it comes to what open source software to use: <a href="http://www.joomla.org/">Joomla</a>, <a href="http://wordpress.org">WordPress</a>, <a href="http://drupal.org/">Drupal</a>&#8230;but aren’t they at times &#8211; a little overkill? For smaller web designers like myself, I still get the usual client who just wants a simple website to advertise their services. Most of the time they will have something existing &#8211; with cluttered content that isn’t even enough to fill a full page. This is where a single page portfolio comes handy. In this tutorial, we’re going to build a single page portfolio from scratch: a page with a feature section, testimonials, image gallery and a contact form.</p><div class="viewdemo"> <a href="http://demo.fearlessflyer.com/html/demo/one/">View the Demo:</a></div><div class="special"> This tutorial is the first of three parts: 1) the Photoshop Mock up, 2) <strong><a href="http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/">Coding the HTML / CSS</a></strong> and finally 3) <strong><a href="http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/">Adding PHP / jQuery</a>.</strong></div><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/part1.jpg" alt="part1" title="This is the first part of a 3 part series" width="576" height="189" class="alignnone size-full wp-image-1119"  style="border:0;"/></p><h3>The Output</h3><p>Below is a preview of what we’re building. The aim is to have a mock up that is fully layered, so we can optimize for the purpose of SEO and page performance. Ready to get started &#8211; Let’s begin:</p><p><a href="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-1-large.jpg"><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-1.jpg" alt="single-page-1" title="This is How the Page looks so far - Click to enlarge" width="576" height="923" class="alignnone size-full wp-image-902" /></a></p><h3>Part 1 &#8211; The Fold</h3><p>We’re going to design the page from the top to bottom. The fold is first part of a web page can see &#8211; without having to scroll downwards. In our case, this includes the header and the big red feature bar:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-0.jpg" alt="single-page-0" title="The fold is the first thing you see in a web page" width="576" height="248" class="alignnone size-full wp-image-901" /></p><p>If you aren’t familiar with 960.gs &#8211; it’s a CSS framework that follows the standard 960 pixels page width rule. Download the photoshop template and check out the guides &#8211; we are building the page following the 960 grid rules:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-2.jpg" alt="single-page-2" title="The 960 Photoshop Template showing the pink layers and guides to help you align elements" width="576" height="581" class="alignnone size-full wp-image-904" /></p><p>Create a new layer &#8211; this will be the fold layer. Select the full page width, with approximately 380 pixels in height. Fill it with a solid color &#8211; in my case I chose a bright red #730701:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-3.jpg" alt="single-page-3" title="The Fold Fill Layer" width="576" height="581" class="alignnone size-full wp-image-905" /></p><p>Create another layer for the header bar, select the full page width and 48 pixels in height. Fill this with another solid color &#8211; in my case, #bcbcbc for light grey.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-4.jpg" alt="single-page-4" title="The Header Fill Layer" width="576" height="581" class="alignnone size-full wp-image-906" /></p><p>Where the header bar and the fold meet, we want to add an “etched” effect. We achieve this by using 2 lines using the “line” tool. Create 2 horizontal lines at 1 pixel each (make sure you hold the “Shift” key) as you drag it across the page. Nudge one line so that they sit just on top of one another. The rule is to use a lighter shade for one line, and a darker for the other (it is important that you play with the colors, and zoom out and test if the etched look is achieved). Add a subtle gradient fill for the header bar as well.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-5.jpg" alt="single-page-5" title="Two Horizontal Lines create an Etched Effect" width="576" height="313" class="alignnone size-full wp-image-907" /></p><p>The next step is to add a large feature image. This sits on top of all the layers to give it that 3D effect. Place in at almost half the 960 pixel page width, overlapping some part of the header and pass below the fold. Include the effects as shown:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-6.jpg" alt="single-page-6" title="Large Overlapping Feature Images are So In!" width="576" height="308" class="alignnone size-full wp-image-908" /></p><p>Immediately to the left of the feature image, add your large slogan text. This is to be your attention grabbing statement, and is important to be the most prominent. I chose Rockwell at size 36 pixels, with -50 tracking. Also add the following text effects:</p><ul><li>Drop shadow &#8211; Normal blend mode &#8211; #000, 90 degrees angle, 1px distance, 0 spread and 1px in size</li><li>Inner Shadow  &#8211; Normal blend mode &#8211; #FFF, 90 degrees angle, 1px distance, 0 choke and 0px size</li><li>Gradient Overlay &#8211; use default settings, reduce opacity to 34% and 90 degrees in angle</li></ul><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-7.jpg" alt="single-page-7" title="Large Slogan Text with my Favorite font - Rockwell" width="576" height="581" class="alignnone size-full wp-image-909" /></p><p>Add a gradient effect to the background layer named the fold. The rule is to use a slightly lighter color than the existing background as one color, and the same background color as the secondary color. Fill by pressing the shift key and releasing simultaneously.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-8.jpg" alt="single-page-8" title="Add some gradient effects Baby!" width="576" height="418" class="alignnone size-full wp-image-910" /></p><p>Add another 2 horizontal lines right underneath the slogan text. *Use the rule as described in the previous line tools used in the header and the fold separation. Add a smaller set of text &#8211; I used Arial with 14 pixels in size, #FFFFFF color.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-9.jpg" alt="single-page-9" title="Here goes that Etched Borders again" width="576" height="452" class="alignnone size-full wp-image-911" /></p><p>To complete the fold &#8211; we add a glow effect to the bottom area where the borders separate the large text and the small text. Select a small area (shown below), grab the brush tool, select white for the color, increase the brush radius (shown below) &#8211; reduce the opacity all the way to 12 percent and daub a quick light stroke.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-10.jpg" alt="single-page-10" title="Give it a little glow" width="576" height="425" class="alignnone size-full wp-image-912" /></p><h3>Part 2 &#8211; Below the Fold</h3><p>Below the fold technically includes everything under the fold. But for the sake of this tutorial &#8211; it includes all BUT the footer section. The reason is &#8211; this will be the only part that will need to grow. If there was additional content to be made &#8211; it will be inside this section. The fold and the footer remain static in height.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-11.jpg" alt="single-page-11" title="Below the fold is the area you see when you scroll downwards" width="576" height="476" class="alignnone size-full wp-image-913" /></p><p>We start by creating a new layer. With the selection tool, select everything below the red feature section below. Fill this selection with #f3f2ed using the paint bucket tool. *Note that the large image layer should be placed on top of all the other layers.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-12.jpg" alt="single-page-12" title="Layer should be beneath the large image layer!" width="576" height="581" class="alignnone size-full wp-image-914" /></p><p>We then create a new horizontal guide. This guide should be right below our feature image (allow a few pixels extra for the added shadow effect). This guide’s main purpose is to know where we will slice our divs (which I will cover once we start coding) and where our gradient ends. Grab the selection tool once more and start from where the red area ends &#8211; down to the new guide. Using the gradient tool, select #e1decf primary color and #f3f2ed and fill with a straight line (hold shift).</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-13.jpg" alt="single-page-13" title="So subtle gradients are soo nice!" width="576" height="314" class="alignnone size-full wp-image-915" /></p><p>We then add that same “etched” look where the two layers meet. The same technique is used &#8211; create two lines with one darker and one lighter. In this case the upper line has #670600 fill and the second #faf9f3.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-14.jpg" alt="single-page-14" title="Again - etched borders!" width="576" height="203" class="alignnone size-full wp-image-916" /></p><p>Next step is to create the sub heading. With the type tool, choose the Rockwell font at 24 pixels in #292929 color and type the word “TESTIMONIALS”. Directly to the left of the text &#8211; I imported the “users_two_48” icon from <a href="http://wefunction.com/2008/07/function-free-icon-set/">WeFunction</a> and scaled the image down to 60 percent and desaturize (Ctrl + U, slide the saturation all the way to the left).  Add two horizontal 1 pixel lines (#e5e5e2 and #FFFFFF) directly underneath (by this point of the tutorial, I’m going to assume you have this technique down already).</p><p>*Tip &#8211; Create a group called “sub headings” and add all the above elements in it. We will be duplicating this sub heading in following sections.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-15.jpg" alt="single-page-15" title="WeFunction icons - desaturated please" width="576" height="430" class="alignnone size-full wp-image-917" /></p><p>Directly below the Testimonial subheading &#8211; we create 3 text boxes with some dummy text. I used Verdana at 14 pt, 20 pt leading. Make sure you allow enough padding and margin around each surrounding box. Align according to the grid. Note that this part of the design acts only as a marker. We will use actual text for these boxes.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-16.jpg" alt="single-page-16" title="Three boxes make up the testimonials section" width="575" height="479" class="alignnone size-full wp-image-918" /></p><p>Duplicate the two horizontal lines from the sub headings section. Move these 2 lines right below the 3 text boxes that you have created. Create a new layer, select 124 pixels (width) x 25 pixels (height) and fill with #FFFFFF with the paint bucket tool. Move this layer right below the two horizontal lines. Using the text tool, use 10 pt Verdana, color # 6b6b6b and type the words “more testimonials” &#8211; move this directly on top of the new layer we’ve just created. This acts as end marker for the testimonials section with a button that displays more testimonials.</p><p>*Tip &#8211; create a new group for the above elements and name it “end marker”.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-17.jpg" alt="single-page-17" title="More buttons for added user interaction" width="576" height="288" class="alignnone size-full wp-image-919" /></p><p>Next, we add a “Previous Work” section. Remember that we created a group called “sub headings” a little while back? Duplicate this group and name it “sub headings 2”. Using the down cursor in your keyboard, move the new group approximately 560 pixels downwards. Change the text to say “PREVIOUS WORK” and use another icon, scale it down and desaturate.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-18.jpg" alt="single-page-18" title="Another Heading with a desaturated icon" width="576" height="281" class="alignnone size-full wp-image-920" /></p><p>An image gallery will showcase our portfolio’s “Previous Work” section. Similar to the testimonials area, we are dropping some dummy thumbnails in our photoshop file, just for mock purposes. We are going to span 4 thumbnails across at 210 pixels each in width. Make sure the thumbnails align to the grid, taking 3 columns each with enough paddings in between each other. Add the following effects for each thumbnail: Drop Shadow (settings shown in below screenshot) and an inside stroke of 6 pixels and #FFFFFF fill color.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-19.jpg" alt="single-page-19" title="Photo gallery of your previous work" width="576" height="720" class="alignnone size-full wp-image-921" style="border:0;"/></p><p>To complete the “Below the Fold” section &#8211; we create an end marker for the “Previous Work” area. Duplicate the group “end marker” and name it “end marker 2”. Move this newly created group approximately 380 pixels downwards. Change the text in the button to say “more previous work”. Our next quest is the <strong>Footer</strong>. Keep going!</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-20.jpg" alt="single-page-20" title="Again, a more button is added below" width="576" height="319" class="alignnone size-full wp-image-922" /></p><h3>Part 3 &#8211; The Footer</h3><p>And now we come to the final piece of the design process &#8211; the Footer. I enjoy designing footers because they represent completion; they’re also the most overlooked section of a page that I feel that it deserves the same attention as the other parts.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-21.jpg" alt="single-page-21" title="After user sees your work - they would want to get in touch with you!" width="576" height="206" class="alignnone size-full wp-image-923" /></p><p>The height of the footer is approximately 375 pixels. If you haven’t already done so &#8211; extend your canvas size to an additional 375 pixels &#8211; but be sure to click the anchor all the way to the top.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-22.jpg" alt="single-page-22" title="Canvas settings for your Footer" width="576" height="391" class="alignnone size-full wp-image-924" style="border:0;"/></p><p>Create 3 new horizontal guides: first is where the “Below the Fold” background ends, then approximately 35 pixels below, and third &#8211; another 30 pixels down (this is where the footer background layer starts). Make a selection from the first guide to the next one down, make sure you’re on the “Below the fold” background layer, and do a gradient fill: primary color #e3e0d2, secondary #f3f2ed. Next, create a new layer for the footer background and add a gradient fill: primary color is #361f01 and secondary #493215. Do 80 percent for the primary fill. Finally, create 3 horizontal lines with the line tool at 1 pixel each with the following fills (in the following order): #ffffff, #000000 and #624825. Line them according the last guide you’ve created (see below).</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-23.jpg" alt="single-page-23" title="Gradients and Horizontal Lines are good" width="576" height="581" class="alignnone size-full wp-image-925" /></p><p>Duplicate the text layer for the slogan (The Fold), change the content to say “Hire me for professional work”, drag downwards to the footer, and place on the left half of the footer area. Add another text area, use Verdana, 12px #ffffff, enter some dummy text, and place directly below the large text.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-24.jpg" alt="single-page-24" title="Slap the same text effect onto the footer slogan to match the header" width="576" height="225" class="alignnone size-full wp-image-926" /></p><p>On the right half of the footer, we’re placing a rounded rectangle for the background of the contact form. Using the Rounded Rectangle tool &#8211; create a rectangle, center between 6 columns in the grid. Add a drop shadow and stroke effect as shown below:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-25.jpg" alt="single-page-25" title="A rounded container for the form" width="576" height="880" class="alignnone size-full wp-image-927" style="border:0;" /></p><p>Create a new layer and make 3 rectangles inside the rounded rectangle we’ve just created. These will act as the form fields. Note that these are just as markers which will not really be used in the output. We’re using real form fields in the code. Fill these rectangles with #ffffff using the paint bucket tool.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-26.jpg" alt="single-page-26" title="Form fields are useful" width="576" height="352" class="alignnone size-full wp-image-928" /></p><p>What’s a contact form without a pretty submit button? Using the rounded rectangle tool &#8211; create a button and add an inner shadow (66 percent opacity) and a 1px inner stroke &#8211; #85827e. Add the text “Submit” on top of this button using “Rockwell” at 14px.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-27.jpg" alt="single-page-27" title="We need a submit button" width="576" height="161" class="alignnone size-full wp-image-929" /></p><p>Finally, remember I said the footer should have the same detail as the other parts of the page? We’re going to add a nice glow in the background which will highlight our large text and the contact form. Select the footer background with the selection tool. Next, pick a soft round brush at 500 pixels, select color #ffffff and decrease the opacity of the brush to 10 percent. Center the brush horizontally and halfway above the footer &#8211; click once and Voila &#8211; instant glow in the background!</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-28.jpg" alt="single-page-28" title="Finish up with a nice glow" width="576" height="529" class="alignnone size-full wp-image-930" /></p><p>And there you have it. We’ve just created a full page mockup in Photoshop. Next will be coding the HMTL and CSS &#8211; so stay tuned!</p><div class="special"> This tutorial is the first of three parts: 1) the Photoshop Mock up, 2) <strong><a href="http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/">Coding the HTML / CSS</a></strong> and finally 3) <strong><a href="http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/">Adding PHP / jQuery</a>.</strong></div><p><strong>You can download the .psd from this <a href="http://fearlessflyer.com/downloads/one-page-portfolio-psd.zip">link</a></strong></p> ]]></content:encoded> <wfw:commentRss>http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Taming the Grid – Align your WordPress posts perfectly using PHP and CSS</title><link>http://fearlessflyer.com/2009/10/taming-the-grid-align-your-wordpress-posts-perfectly-using-php-and-css/</link> <comments>http://fearlessflyer.com/2009/10/taming-the-grid-align-your-wordpress-posts-perfectly-using-php-and-css/#comments</comments> <pubDate>Sat, 03 Oct 2009 22:39:12 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[WP Themes]]></category> <category><![CDATA[grid]]></category> <category><![CDATA[grid-based]]></category> <category><![CDATA[modulus]]></category> <category><![CDATA[php]]></category> <category><![CDATA[pixel-perfect]]></category> <category><![CDATA[the grid]]></category> <category><![CDATA[the loop]]></category> <category><![CDATA[Wordpress]]></category><guid isPermaLink="false">http://fearlessflyer.com/?p=750</guid> <description><![CDATA[Grid based web design is becoming an art that each web developer must master. News portals, magazine layouts as well as showcase websites all adhere to the intricacies of the grid – which when mastered, is definitely a good addition to your web skill arsenal. We all know that a typical grid design uses some [...]]]></description> <content:encoded><![CDATA[<p>Grid based web design is becoming an art that each web developer must master. News portals, magazine layouts as well as showcase websites all adhere to the intricacies of the grid – which when mastered, is definitely a good addition to your web skill arsenal.</p><p>We all know that a typical grid design uses some kind of block containers to house content. This block container may be DIV or list that span a couple, three or four times across inside a parent DIV. Now with CSS – we simply apply the proper left or right margins to all the containers except the last one in the pattern:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/10/illustration1.png" alt="illustration1" title="children DIVs with different margin settings" width="576" height="222" class="alignnone size-full wp-image-751" style="border:0;" /></p><p>The result is the children containers line up perfectly inside the parent DIV. To achieve this effect we apply the same class to all the children DIVs, and append a unique class to the last one like below:</p><p><strong>HTML</strong></p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;parent&quot;&gt;
&lt;div class=&quot;child&quot;&gt;
	//content goes here
&lt;/div&gt;
&lt;div class=&quot;child&quot;&gt;
	//content goes here
&lt;/div&gt;
&lt;div class=&quot;child last&quot;&gt;
	//content goes here
&lt;/div&gt;
&lt;/div&gt;</pre></td></tr></table></div><p><strong>CSS</strong></p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.parent</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;">415</span> <span style="color: #993333;">px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.child</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;">125px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.child</span><span style="color: #6666ff;">.last</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><h3>The Challenge:</h3><p>Since content inside these containers are typically coded using a form of recursive technique such as “the Loop” in Wordress; how are we to designate that unique class to that second, third or fourth child DIV?</p><p>For instance, if we were to house our posts inside one of these children DIVs, the PHP would look something like below:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;div id=&quot;parent&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>the_post<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>
&lt;div class=&quot;child&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<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>
&lt;/div&gt;&lt;!--child--&gt;
&lt;/div&gt;&lt;!--parent--&gt;</pre></td></tr></table></div><p>This block of code inside the parent DIV will just keep repeating for all posts with the same “child” class. We need to a way to select just the second, third or fourth child to not have that extra margin.</p><h3>The Trick</h3><p>A not so popular arithmetic operator known as the modulus &#8211; represented by a (%) symbol is what we’ll use to do the trick. The modulus operator is the same as division &#8211; but returns the remainder instead. Since we’re only targeting every “nth” div or child item, all we need to create is a pattern that has a multiple of some value in order to apply our special class. Take a look at the code below:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;div id=&quot;parent&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$r_count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>the_post<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>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$r_count</span><span style="color: #339933;">%</span><span style="color:#800080;">3</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$r_class</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'last'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$r_class</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
 	<span style="color: #009900;">&#125;</span>
	<span style="color: #000088;">$r_count</span><span style="color: #339933;">++;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div class=&quot;child <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$r_class</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<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>
&lt;/div&gt;&lt;!--child--&gt;
&lt;/div&gt;&lt;!--parent--&gt;</pre></td></tr></table></div><p>First we create a variable $r_count and initialize its value at 1 right before the loop starts. Right after the call for the posts, we add a conditional statement with the modulus operator for 3 is equal to 0 (since we want every 3rd element to have that unique “last” class), everything else returns empty. Lastly, we increment $r_count by one.</p><p>In our HTML, we call the regular “child” class, then we echo our special $r_class. The end result will be an alternating call of styles depending on what we define for our modulus operator:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/10/illustration2.png" alt="illustration2" title="A view of the source code of our finished product. Notice the additional class for the DIVs" width="576" height="500" class="alignnone size-full wp-image-753" style="border:0;" /></p><p>Of course &#8211; depending on the number of columns you would like to display &#8211; all you have to do is change the modulus operand and you should get the same effect. Thanks to PHP master <a href="http://www.goliathdesigns.com/">David Young</a> &#8211; who showed me how to do this trick.</p> ]]></content:encoded> <wfw:commentRss>http://fearlessflyer.com/2009/10/taming-the-grid-align-your-wordpress-posts-perfectly-using-php-and-css/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>How to change the Background Dynamically in your WordPress Theme</title><link>http://fearlessflyer.com/2009/05/how-to-change-the-background-dynamically-in-your-wordpress-theme/</link> <comments>http://fearlessflyer.com/2009/05/how-to-change-the-background-dynamically-in-your-wordpress-theme/#comments</comments> <pubDate>Sat, 09 May 2009 19:01:44 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[Blog]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[php]]></category> <category><![CDATA[Themes]]></category> <category><![CDATA[tips]]></category> <category><![CDATA[tricks]]></category> <category><![CDATA[Wordpress]]></category> <category><![CDATA[WP]]></category> <category><![CDATA[WP Themes]]></category><guid isPermaLink="false">http://fearlessflyer.com/?p=486</guid> <description><![CDATA[We all have seen WordPress sites with repeating backgrounds that span beautifully across the entire page. This property is usually applied in the body tag of your template. What about those portfolio websites that use a different background image in the front page? Or those magazine styled websites that apply different backgrounds for their category [...]]]></description> <content:encoded><![CDATA[<p>We all have seen WordPress sites with repeating backgrounds that span beautifully across the entire page. This property is usually applied in the body tag of your template.  What about those portfolio websites that use a different background image in the front page? Or those magazine styled websites that apply different backgrounds for their category pages? How’d they do that?</p><h3>The problem</h3><p>For anyone who’s developed a WordPress theme would know how to break it up in templates: header.php, sidebar.php , footer.php etc. And as I’ve mentioned: you control the background image (if you want it to span the entire page) usually in the body tag of your HTML.  The problem is – the body tag comes BEFORE any other tag in your templates.</p><p>For example, take a look at the screenshot of a typical header.php file below. It shows the body tag where you apply a different property value in the CSS file each time you want it unique from another page:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/05/bg-tut1.jpg" alt="bg-tut1" title="bg-tut1" width="576" height="200" class="alignnone size-full wp-image-488" /></p><p>The problem is, in your special template, you’ve already called the get header file:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/05/bg-tuts2.jpg" alt="bg-tuts2" title="bg-tuts2" width="576" height="200" class="alignnone size-full wp-image-487" /></p><h3>The Answer – Conditional Tags</h3><p>WordPress is built is such a way that you can control almost every aspect of your pages. One useful snippet is known as Conditional Tags. Conditional tags can be used in your templates to change what is displayed on a particular page – like the background image. Examples of conditional tags are: is_single(), is_front_page() or is_admin(). For more information on Conditional Tags – see the this <a href="http://codex.wordpress.org/Conditional_Tags">link</a> from WordPress Codex library. In our case – we’re going to use the tag is_page_template().</p><h3>Step 1: Insert the PHP</h3><p>Open your header.php in your text editor. You’re going to add a conditional statement in inside the opening body id tag. In my case, I’m using three different backround images. Two of them, I want to apply in two individual templates, while the rest of the pages share a default image:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;body id=&quot;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_page_template<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template-diff-bg-demo1.php'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
       <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;template-diff-bg-demo1&quot;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span> 
<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span>is_page_template<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template-diff-bg-demo2.php'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
       <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;template-diff-bg-demo2&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;default&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; &gt;</pre></td></tr></table></div><p><strong>Explanation:</strong> If the template used is named “template-diff-bg-demo1.php”, echo a body id of “template-diff-bg-demo1”, or if template used is named “template-diff-bg-demo2.php” use body id of “template-diff-bg-demo2”, otherwise – just use body id of “default”.</p><h3>Step 2: The CSS</h3><p>Open your styles.css. We’re going to match the body ids that are going to be called each time you switch page templates. In our case – we need three different ids:</p><ul><li>body# template-diff-bg-demo1 – a different background</li><li>body# template-diff-bg-demo2 – another background</li><li>body#default – the default background</li></ul><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">body<span style="color: #cc00cc;">#default</span> <span style="color: #00AA00;">&#123;</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;">images/default-bg.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #993333;">center</span> <span style="color: #993333;">no-repeat</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
body<span style="color: #cc00cc;">#template-diff-bg-demo1</span> <span style="color: #00AA00;">&#123;</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>images/default-bg2.jpg<span style="color: #00AA00;">&#41;</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #993333;">center</span> <span style="color: #993333;">no-repeat</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
body<span style="color: #cc00cc;">#template-diff-bg-demo2</span> <span style="color: #00AA00;">&#123;</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>images/default-bg3.jpg<span style="color: #00AA00;">&#41;</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #993333;">center</span> <span style="color: #993333;">no-repeat</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><h3>Conclusion</h3><p>There you have it. We dynamically changed the body ids of our theme – according to specific page templates. Changing the body ids allowed us style them differently in our stylesheet. This is just one of many possibilities in displaying content (or in our case – style) by using WordPress’ conditional tags. Check out the demo using the code above from this <a href="http://squid.fearlessflyer.com/page-2/">link</a>. Happy Coding!</p><p><a href="http://squid.fearlessflyer.com/page-2/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/05/bg-tuts3.jpg" alt="bg-tuts3" title="bg-tuts3" width="600" height="200" class="alignnone size-full wp-image-489" /></a></p> ]]></content:encoded> <wfw:commentRss>http://fearlessflyer.com/2009/05/how-to-change-the-background-dynamically-in-your-wordpress-theme/feed/</wfw:commentRss> <slash:comments>9</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)

Served from: fearlessflyer.com @ 2010-09-07 01:44:54 -->