<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.3" -->
<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/"
	>

<channel>
	<title>edrackham &#187; CSS</title>
	<link>http://edrackham.com</link>
	<description>PHP, MySQL, and Other Web Snippets!</description>
	<pubDate>Tue, 10 Feb 2009 14:52:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
	<language>en</language>
			<item>
		<title>Simple Web 2.0 Design and CSS Tutorial</title>
		<link>http://edrackham.com/css/simple-web-20-design-and-css-tutorial/</link>
		<comments>http://edrackham.com/css/simple-web-20-design-and-css-tutorial/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 16:37:28 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Photoshop]]></category>
<category>css</category><category>layout</category><category>photoshop</category><category>Tutorial</category><category>web2.0</category><category>xhtml</category>
		<guid isPermaLink="false">http://edrackham.com/css/simple-web-20-design-and-css-tutorial/</guid>
		<description><![CDATA[This tutorial aims at teaching you how to make a simple &#034;Web 2.0&#034; design.


Setup
To start, let&#039;s create a new document in Photoshop, 1024px (width) by 700px (height).


Guides
Now, lets set up predefined areas (for areas like the header, and content) using guides. We will be creating four guides for now.



First Guide: Horizontal, position: 160px
Second Guide: Horizontal, [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial aims at teaching you how to make a simple &#034;Web 2.0&#034; design.</p>
<p><a href='http://www.mediafire.com/?m1umgjhexzv' title="Download all the files used in this tutorial"><img src="http://edrackham.com/images/download_tut_files.png" alt="Download Tutorial Files" border="0" /></a></p>
<p><a href="http://www.edrackham.com/tutorials/simple-web20-layout-in-photoshop/" title="My final design"><img src="http://edrackham.com/images/view_it.png" alt="View Final Design" border="0" /></a></p>
<h3>Setup</h3>
<p>To start, let&#039;s create a new document in Photoshop, 1024px (width) by 700px (height).</p>
<p><a href="http://imgplace.com/image/view/035e6910e639bb75b011705577421ed9" target="_blank" title="View Larger Image"><img src="http://imgplace.com/image_bin/2510/035e6910e639bb75b011705577421ed9.png.th.jpg" border="0" alt="Document Setup"></a></p>
<div style="clear: both;"></div>
<h3>Guides</h3>
<p>Now, lets set up predefined areas (for areas like the header, and content) using guides. We will be creating four guides for now.</p>
<p><a href="http://imgplace.com/image/view/7b82fc1da823cdc0474ac72b18234e98" target="_blank" title="View Larger Image"><img src="http://imgplace.com/image_bin/3291/7b82fc1da823cdc0474ac72b18234e98.png.th.jpg" border="0" alt="Creating New Guides"></a></p>
<div style="clear: both;"></div>
<ul>
<li><strong>First Guide:</strong> Horizontal, position: 160px</li>
<li><strong>Second Guide:</strong> Horizontal, position: 620px</li>
<li><strong>Third Guide:</strong> Vertical, position: 62px</li>
<li><strong>Fourth Guide:</strong> Vertical, position: 962px</li>
</ul>
<p>You should now have something that resembles the following (ignore the fact that there&#039;s the BG coloured in there, that wasn&#039;t supposed to be there just yet):</p>
<p><a href="http://imgplace.com/image/view/8427781b4c9e2dbb44c11cd24a058a85" target="_blank" title="View Larger Image"><img src="http://imgplace.com/image_bin/4841/8427781b4c9e2dbb44c11cd24a058a85.png.th.jpg" border="0" alt="Our Guides"></a></p>
<div style="clear: both;"></div>
<h3>Background</h3>
<p>&#034;Web 2.0&#034; seems to be all about gradients, so choose a foreground and background colour. I used foreground: #6d6657 and background: #302a1d. Use the gradient tool, then click at the top of the document, and drag down to the first horizontal guide (160px down). You should have something like the following:</p>
<p><a href="http://imgplace.com/image/view/ce7986f13ebd89efe64d6cad3adf9ad5" target="_blank" title="View Larger Image"><img src="http://imgplace.com/image_bin/8870/ce7986f13ebd89efe64d6cad3adf9ad5.png.th.jpg" border="0" alt="Background"></a></p>
<div style="clear: both;"></div>
<p>
<div align="center"><script type="text/javascript"><!--
google_ad_client = "pub-4159646232668987";
/* 468x60, created 3/10/08 */
google_ad_slot = "7234899452";
google_ad_width = 468;
google_ad_height = 60;
google_cpa_choice = ""; // on file
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
</p>
<h3>Content Area</h3>
<p>Choose the rounded rectangle tool, and set a corner radius of 10px. Now make sure that your window is expanded a little more than the actual document size so that you can begin to draw your content area just outside the top of the document. Start about 15px above the document, and at the first vertical guide (62px in). Drag out a rounded rectangle down to the bottom horizontal guide, and aligned with the right hand vertical guide (962px in). You should see the following:</p>
<p><a href="http://imgplace.com/image/view/124c5d9ec60354b9d440c5243440910b" target="_blank" title="View Larger Image"><img src="http://imgplace.com/image_bin/5796/124c5d9ec60354b9d440c5243440910b.png.th.jpg" border="0" alt="Content Background"></a></p>
<div style="clear: both;"></div>
<p>Now, add the following layer style to the rounded rectangle:</p>
<p><a href="http://imgplace.com/image/view/b16464d0997d72b4d8342e82f512a7d3" target="_blank" title="View Larger Image"><img src="http://imgplace.com/image_bin/9182/b16464d0997d72b4d8342e82f512a7d3.png.th.jpg" border="0" alt="Content Area Style"></a></p>
<div style="clear: both;"></div>
<h3>Header</h3>
<p>Now lets set up the header. Create a new layer and use the Rectangular Marquee Tool and draw from the top left of the document all the way to the right, and down to the first horizontal guide. Fill with a colour of your choice. If you&#039;re following this guide, I used #918977. Change the blend mode to &#039;Darker Color&#039; and add a drop shadow using the following settings:</p>
<p><a href="http://imgplace.com/image/view/8c4fb525fdd13ba1fc957d37866370d1" target="_blank" title="View Larger Image"><img src="http://imgplace.com/image_bin/9816/8c4fb525fdd13ba1fc957d37866370d1.png.th.jpg" border="0" alt="Header Style"></a></p>
<div style="clear: both;"></div>
<p>Now grab a decent pattern, there are some nice ones at <a href="http://squidfingers.com/patterns/" title="Lots of nice patterns">SquidFingers</a>. Choose one, open it in photoshop and <a href="http://www.hongkiat.com/blog/creating-custom-pattern-in-photoshop/" title="How to define a pattern in Photoshop">define it as a pattern</a> (steps 1 &#038; 2 only). <strong>IMPORTANT:</strong> Remember the width of the image. Mine is 34px. Once you have your pattern defined, bring up the main layout document we&#039;re working on and Ctrl+Click on the image part of the header layer in the layers panel. This should have selected the header section. Create a new layer above and choose Edit > Fill. Select your newly defined pattern, and fill this header area.</p>
<p>Now, set the Blending Mode to Luminosity, and press Q to enter Quick Mask mode. In Quick Mask mode, with the new layer selected (with the nice pattern on it) - choose the Gradient tool.</p>
<p><a href="http://imgplace.com/image/view/8b361b64c9ea67fe133a29e275a3a877" target="_blank" title="View Larger Image"><img src="http://imgplace.com/image_bin/5965/8b361b64c9ea67fe133a29e275a3a877.png.th.jpg" border="0" alt="Gradient Tool"></a></p>
<div style="clear: both;"></div>
<p>Drag a gradient from the top of the screen, down to the first horizontal guide (160px down). You&#039;ll have a red gradient, don&#039;t worry about that - we&#039;re in Quick Mask mode and it&#039;s supposed to do that. Now press Q to exit the Quick Mask mode, then press delete. Your pattern should now fade out as it gets closer to the bottom of the header section:</p>
<p><a href="http://imgplace.com/image/view/49e0b218929927ad5cb24462db3d9353" target="_blank" title="View Larger Image"><img src="http://imgplace.com/image_bin/7833/49e0b218929927ad5cb24462db3d9353.png.th.jpg" border="0" alt="Gradient Header"></a></p>
<div style="clear: both;"></div>
<p>
<div align="center"><script type="text/javascript"><!--
google_ad_client = "pub-4159646232668987";
/* 468x60, created 3/10/08 */
google_ad_slot = "7234899452";
google_ad_width = 468;
google_ad_height = 60;
google_cpa_choice = ""; // on file
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
</p>
<h3>Saving your Slices</h3>
<p>That&#039;s your layout basically done (without any content / images). Now to save the slices for our XHTML layout. Create two new horizontal guides, the first one set with a position of 170px, and the second with a position of 610px. Now, use the slice tool, and create a slice from the top left, across the entire width, and down to the first new horizontal guide (170px down). Create a second slice starting from the left and down at 170px, drag it all the way to the right and down to the second new horizontal guide. Create a third slice with the remaining space. You should have the following:</p>
<p><a href="http://imgplace.com/image/view/5bc07cb2e1a5055daf11726abcea4df3" target="_blank" title="View Larger Image"><img src="http://imgplace.com/image_bin/6039/5bc07cb2e1a5055daf11726abcea4df3.png.th.jpg" border="0" alt="Saving Slices"></a></p>
<div style="clear: both;"></div>
<p>Now choose &#039;File > Save for Web &#038; Devices&#039; and save the images. This process will create a folder in your directory you chose to save them in. Within this folder will be your three sliced images. Browse to that folder, and delete the middle image. We don&#039;t need this. Name the header slice &#039;header&#039; and the footer image &#039;footer&#039;. Move both the header and footer images to your web image directory.</p>
<p>Now, back in photoshop, using the Rectangular Marquee tool select from the top left, all the way to the bottom and go in the number of pixels that match the width of your pattern you used earlier from the left edge of the document. Goto Edit > Copy Merged, then click File > New Document and make sure the dimensions are <<em>width of pattern</em>>px by 700px. Paste in the copied image, then File > Save for Web &#038; Devices. Save this image as &#039;main_bg&#039;. This is your main background image. Now, choose the Single Row Marquee Tool, and click once in the middle section of your main document (anywhere that the second slice contains). Do the same as before with the vertical slice&#8230; copy merged, open a new document, paste it in and save for web as &#039;content_bg&#039;.</p>
<p>You should now have 4 main images:</p>
<ul>
<li>header</li>
<li>footer</li>
<li>main_bg</li>
<li>content_bg</li>
</ul>
<h3>Creating the XHTML / CSS</h3>
<p>Firstly, lets set up our directory structure. We will be needing the following:</p>
<ul>
<li>index.html</li>
<li>design.css</li>
<li>folder for images</li>
</ul>
<p>We will be wanting a final directory structure that resembles the following:</p>
<pre>+-my layout/
  |
  +-img/
  | |
  | +- content_bg.png
  | +- footer.png
  | +- header.png
  | +- main_bg.png
  |
  +- design.css
  +- index.html</pre>
<p>Navigate to your root folder for this tutorial (where the files are going to be saved). Create a new folder called <strong>img</strong> and copy your images into it.</p>
<p>Now create the XHTML document (<strong>index.html</strong>). Let&#039;s use the following Dreamweaver default as a nice structure to work from:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="sc0">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span><br />
<span class="sc2"><a href="http://december.com/html/4/element/html.html"><span class="kw2">&lt;html</span></a> xmlns=<span class="st0">&#034;http://www.w3.org/1999/xhtml&#034;</span><span class="kw2">&gt;</span></a></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/head.html"><span class="kw2">&lt;head&gt;</span></a></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/meta.html"><span class="kw2">&lt;meta</span></a> <span class="kw3">http-equiv</span>=<span class="st0">&#034;Content-Type&#034;</span> <span class="kw3">content</span>=<span class="st0">&#034;text/html; charset=utf-8&#034;</span> /<span class="kw2">&gt;</span></a></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/title.html"><span class="kw2">&lt;title&gt;</span></a></span>My Web2.0 Layout<span class="sc2"><span class="kw2">&lt;/title&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;/head&gt;</span></span></p>
<p><span class="sc2"><a href="http://december.com/html/4/element/body.html"><span class="kw2">&lt;body&gt;</span></a></span><br />
<span class="sc2"><span class="kw2">&lt;/body&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;/html&gt;</span></span></div>
</div>
<p>Add the following <strong>div</strong> tags between the <strong>BODY </strong>tags:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">id</span>=<span class="st0">&#034;wrapper&#034;</span><span class="kw2">&gt;</span></a></span><br />
&nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">id</span>=<span class="st0">&#034;header&#034;</span><span class="kw2">&gt;</span></a></span><span class="sc2"><span class="kw2">&lt;/div&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">id</span>=<span class="st0">&#034;content&#034;</span><span class="kw2">&gt;</span></a></span><span class="sc2"><span class="kw2">&lt;/div&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">id</span>=<span class="st0">&#034;footer&#034;</span><span class="kw2">&gt;</span></a></span><span class="sc2"><span class="kw2">&lt;/div&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</div>
<p>Now it&#039;s time for the CSS. Create the new CSS file (<strong>design.css</strong>) and add the following CSS code:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="co1">@charset &quot;utf-8&quot;;</span><br />
<span class="coMULTI">/* CSS Document */</span></p>
<p>body <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">margin</span>: <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">padding</span>: <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">font-family</span>: <span class="st0">&#034;Century Gothic&#034;</span>, Arial, <span class="kw2">sans-serif</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">color</span>: #333333;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">font-size</span>: 12px;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">text-align</span>: <span class="kw2">center</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">background</span>: <span class="kw2">url</span><span class="br0">&#40;</span>img/main_bg.png<span class="br0">&#41;</span> <span class="kw2">repeat-x</span> #302a1d;<br />
<span class="br0">&#125;</span></p>
<p><span class="re0">#wrapper <span class="br0">&#123;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">width</span>: 1024px;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">margin</span>: <span class="kw2">auto</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">text-align</span>: <span class="kw1">left</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="re0">#header <span class="br0">&#123;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">background</span>: <span class="kw2">url</span><span class="br0">&#40;</span>img/header.png<span class="br0">&#41;</span> <span class="kw2">no-repeat</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">height</span>: 170px;<br />
<span class="br0">&#125;</span></p>
<p><span class="re0">#content <span class="br0">&#123;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">background</span>: <span class="kw2">url</span><span class="br0">&#40;</span>img/content_bg.png<span class="br0">&#41;</span> <span class="kw2">repeat-y</span>;<br />
<span class="br0">&#125;</span></p>
<p>#content h1 <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">font-weight</span>: <span class="kw2">normal</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">font-size</span>: 36px;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">color</span>: #918977;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">margin</span>: <span class="nu0">0</span> 80px 5px 80px;<br />
<span class="br0">&#125;</span></p>
<p>#content p <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">margin</span>: <span class="nu0">0</span> 80px 5px 80px;<br />
<span class="br0">&#125;</span></p>
<p><span class="re0">#footer <span class="br0">&#123;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">background</span>: <span class="kw2">url</span><span class="br0">&#40;</span>img/footer.png<span class="br0">&#41;</span> <span class="kw2">no-repeat</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">height</span>: 90px;<br />
<span class="br0">&#125;</span></div>
</div>
<p>Now, attach the stylesheet to your XHTML document using:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="sc2"><a href="http://december.com/html/4/element/link.html"><span class="kw2">&lt;link</span></a> <span class="kw3">href</span>=<span class="st0">&#034;design.css&#034;</span> <span class="kw3">rel</span>=<span class="st0">&#034;stylesheet&#034;</span> <span class="kw3">type</span>=<span class="st0">&#034;text/css&#034;</span> <span class="kw3">media</span>=<span class="st0">&#034;screen&#034;</span> /<span class="kw2">&gt;</span></a></span></div>
</div>
<p>anywhere between the <strong>HEAD </strong>tags.</p>
<p>Voila! We&#039;re done!</p>
<h3>Extras</h3>
<p>Play around with this simple layout design, create new images, change colours and edit the CSS. Take a look at my <a href="http://www.edrackham.com/tutorials/simple-web20-layout-in-photoshop/" title="My final design">final design</a>.</p>
<p>I changed the header image to include a logo and some links, and also added some images to the footer. It seems to be the web2.0 style that you incorporate faint logos at the bottom of your layout.</p>
<p><a href='http://www.mediafire.com/?m1umgjhexzv' title="Download all the files used in this tutorial"><img src="http://edrackham.com/images/download_tut_files.png" alt="Download Tutorial Files" border="0" /></a></p>
<p><a href="http://www.edrackham.com/tutorials/simple-web20-layout-in-photoshop/" title="My final design"><img src="http://edrackham.com/images/view_it.png" alt="View Final Design" border="0" /></a></p>
<p>
<div align="center"><script type="text/javascript"><!--
google_ad_client = "pub-4159646232668987";
/* 468x60, created 3/10/08 */
google_ad_slot = "7234899452";
google_ad_width = 468;
google_ad_height = 60;
google_cpa_choice = ""; // on file
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
</p>
]]></content:encoded>
			<wfw:commentRss>http://edrackham.com/css/simple-web-20-design-and-css-tutorial/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
