<?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>Nettuts+ &#187; Site Builds</title>
	<atom:link href="http://net.tutsplus.com/category/tutorials/site-builds/feed/" rel="self" type="application/rss+xml" />
	<link>http://net.tutsplus.com</link>
	<description>Web Development &#38; Design Tutorials</description>
	<lastBuildDate>Fri, 20 Nov 2009 19:56:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Building a Custom Lifestream Website with Sweetcron</title>
		<link>http://net.tutsplus.com/tutorials/site-builds/building-a-custom-lifestream-website-with-sweetcron/</link>
		<comments>http://net.tutsplus.com/tutorials/site-builds/building-a-custom-lifestream-website-with-sweetcron/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 12:00:28 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Site Builds]]></category>

		<guid isPermaLink="false">http://nettuts.com/?p=954</guid>
		<description><![CDATA[<img src="http://nettuts.s3.amazonaws.com/079_lifeStream/tutimages/sweetcron-200x200.jpg" border="0" alt="LifeStream" />
]]></description>
			<content:encoded><![CDATA[<p>Sweetcron is &#8220;The Automated Lifestream Blog Software&#8221;. It is still in public beta, but is already a very nice blog software package. The beauty of Sweetcron is that new posts are created automatically from your activity elsewhere on the web. New photos on Flickr? Tweets on Twitter? Thumbs up on StumbleUpon? Blog posts on Tumblr? Add them all to your Sweetcron-powered site and they will appear on your site in minutes.</p>
<p><span id="more-954"></span></p>
<div class="tutorial_image">
<a href="http://nettuts.s3.amazonaws.com/079_lifeStream/src.zip"><br />
<img src="http://nettuts.com/wp-content/themes/nettuts/site_images/button_src_nm.jpg" alt=""></a><br />
<a href="http://css-tricks.com/examples/sweetcron/" target="_blank"><br />
<img src="http://nettuts.com/wp-content/themes/nettuts/site_images/button_demo_nm.jpg" alt=""></a></div>
<h3>Step 1: Download Sweetcron &amp; Preparation</h3>
<p>Sweetcron is free and open source! There is a Google Group that hosts the downloads, wiki, discussion group and all that. You&#8217;ll get links to all that by going to the <a href="http://sweetcron.com/">main Sweetcron site</a> and entering your email to download/join.</p>
<p><strong>Before you begin</strong>, know that you&#8217;ll need to be running this on a server which is running PHP (at least version 5, I had to upgrade versions for my demo site). You will also need a MySQL (4.1) database and all the connection info (database name, database username, database password, database hostname).</p>
<p>Download the latest-greatest copy of Sweetcron and then upload the entirety of it to the directory on your web server you wish the blog to reside. The root directory, if you wish it to be at the root of your site, or in a subdirectory like /blog or /lifestream.</p>
<p><strong>Note:</strong> included in the download is an .htaccess file which is required for Sweetcron to run correctly. Some operating systems like to hide this file, so if you don&#8217;t see in in the directory you uploaded to, you&#8217;ll need to create a new one (see the code below).</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/079_lifeStream/tutimages/sweetcron-tut-1.jpg" border="0" /></div>
<h3>Step 2: Install Sweetcron</h3>
<p>The first thing to do is verify your .htaccess file is in place and has the following code in it:</p>
<pre name="code" class="html">
	Options +FollowSymLinks
	RewriteEngine On

	RewriteBase /

	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule ^(.*)$ index.php?/$1 [L]
</pre>
<p>Next, open <strong>system/application/config</strong> and rename the file &#8220;config-sample.php&#8221; to &#8220;config.php&#8221;. Replace the URL with your sites URL. Then rename &#8220;database-sample.php&#8221; to &#8220;database.php&#8221; and fill in those details.</p>
<p><strong>Note:</strong>If you are installing in a subfolder, there two extra steps.</p>
<ol>
<li>In <tt>config.php</tt> make sure the base_url is the full url path to your Sweetcron install, i.e. including subfolder.</li>
<li>Open the <tt>.htaccess</tt> file found at the base of Sweetcron and change <tt>RewriteBase /</tt> to <tt>RewriteBase /<YOUR_SUBFOLDER></tt></li>
</ol>
<p>Now navigate to your site in a web browser and you should be greeted with the final steps for installation (setting your admin account and such).</p>
<h3>Step 3: Configuration</h3>
<p>After you&#8217;ve installed and verified that everything went smoothly, probably the best place to start is to start adding some feeds. Click onto the feeds tab and then the &#8220;Add new Feed&#8221; button on the right.</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/079_lifeStream/tutimages/sweetcron-tut-2.jpg" border="0" /></div>
<p>Simply drop in a feed address in this box and click the &#8220;Add This Feed&#8221; button. If you have the &#8220;real&#8221; feed address (e.g. http://feeds.feedburner.com/nettuts) that is your best bet. However, you can just drop in a regular website URL and it will attempt to auto-detect the feed on that site (e.g. http://nettuts.com/)</p>
<p>Now head over to the Options tab. Here you&#8217;ll see the Title and Admin Email you&#8217;ve already set up, but there are some other important options here. Items per page is self-explanitory, Cron Type isn&#8217;t so obvious. You have two options here: Psuedo-Cron and True Cron. What these options designate is how/when the software does a check of each of your feeds and looks for new items. Pseduo Cron is the default as it requires no server configuration. With Pseduo Cron, if it has been longer than 30 minutes, the next visitor to your site will trigger the job to go look for new feeds. Not a big deal, but that user will experience a longer than normal page load time. True Cron eliminates that problem by having the Server itself trigger that event. If you know what you are doing and can configure your own servers Cron Jobs, click that option and it will give you the URL to hit.</p>
<p>Right after you add your feeds and set your options, you may go back to your site only to find that there are no items! Don&#8217;t worry, it&#8217;s (probably) not broken. It&#8217;s just that 30 minutes have not passed and the Cron job hasn&#8217;t been triggered. If you want to &#8220;force it&#8221;, go back to your options panel, click True Cron, copy the URL and visit it in a browser. This should pull in all your recent feed entries. Or (even easier), click over to the &#8220;Items&#8221; tab and press the &#8220;Fetch New Items Now&#8221; button.</p>
<h3>Step 4: Administration</h3>
<p>The real beauty of Sweetcron is the automation and lifestreaming capabilities, but it is also a regular blogging engine as well. Click the &#8220;Write&#8221; tab to write your own posts, including tagging!.</p>
<p>Another important note about Sweetcron is that it really is a blogging engine, not just a feed parser. What this means is that when it pulls in a new entry (say, a new Twitter Tweet) it makes an entry for that in the Database and that content now officially lives on your site. If you delete that Tweet on Twitter later on, or in any way change the content of the feed, that won&#8217;t automatically change it on your site like it might if you were using a feed parser.</p>
<p>This leads to the last tab in the admin panel: &#8220;Items&#8221;. This shows you each of the entries that you have either written and posted manually or that it has automatically grabbed from one of your feeds. This is very nice I think. You can easily edit, delete, or simple &#8220;unpublish&#8221; and particular entry on your site. This is the kind of simple control you want on a website</p>
<h3>Step 5: Customization</h3>
<p>At this point, your Sweetcron website looks something like this:</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/079_lifeStream/tutimages/sweetcron-tut-3.jpg" border="0" /></div>
<p>That is the default &#8220;Sandbox&#8221; theme. Not much to look at, but is very well built and a great place to start for designing your own theme! The theming structure for Sweetcron is fantastic and should be very familiar for anyone who has used WordPress.</p>
<p>Sweetcron comes with another theme, &#8220;Boxy&#8221;, which Sweetcron&#8217;s lead developer uses on his own personal site. Here is Yong Fook&#8217;s site: </p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/079_lifeStream/tutimages/sweetcron-tut-4.jpg" border="0" /></div>
<p>The &#8220;Boxy&#8221; theme shows off one of the really cool features of Sweetcron, and that is the ability to have each blog post be formatted differently according to its source. Notice how each of the different boxes (posts) on Jon&#8217;s site looks different? The top left box is a photo from Flickr (with the title and info overlayed). The next box is a Twitter tweet (speech bubble with user icon). The top right is a &#8220;digg&#8221;. You are not limited to any particular sources, you can create your own custom designs and apply them to your own custom sources!</p>
<h3>Step 6: Designing a Custom Theme</h3>
<p>As I mentioned, Sweetcron supports custom themes and works in a way very similar to WordPress. Themes exist as directories of the &#8220;themes&#8221; folder which lives at <strong>system/application/views/themes</strong>.</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/079_lifeStream/tutimages/sweetcron-tut-5.jpg" border="0" /></div>
<p>The easiest (and safest) way to get started is to simply duplicate one of the existing themes and modify from there. For my custom theme, I started with the Boxy theme, because it already had the custom-design per-source thing I wanted to use built in.</p>
<p>After you have duplicated and renamed one of the themes, that new theme will show up in the &#8220;Options&#8221; panel in the admin backend. Simply choose it and click the &#8220;Save Options&#8221; button.</p>
<p>Most of the files you&#8217;ll see in your theme folder are fairly self-explanatory. The &#8220;_header.php&#8221; file is your DOCTYPE, head section, and beginning of your body. &#8220;._footer.php&#8221; closes things off (good place for your analytics and such) and &#8220;._sidebar.php&#8221; is (wait for it) your sidebar.</p>
<p>Perhaps the most important file of the theme is the &#8220;_activity_feed.php&#8221; file. This is the main content area of your theme and controls the boxes of each blog entry. Similar to the &#8220;WordPress loop&#8221; this file also contains a loop displaying as many posts as appropriate for that page</p>
<p>Here is the loop, simplified:</p>
<pre name="code" class="php">
&lt;ul id=&quot;activity_list&quot;&gt;
    &lt;?php if ($items): $i = 1; foreach ($items as $item): ?&gt;

        &lt;!-- begin conditional content --&gt;
        &lt;li class=&quot;item &lt;?php echo $item-&gt;get_feed_class()?&gt; &lt;?php if ($i % 3 == 0): ?&gt; last&lt;?php endif; ?&gt;&quot;&gt;

        	&lt;!-- domain-specific boxes --&gt;

			&lt;!-- SOURCE WAS: Twitter --&gt;
        	&lt;?php if ($item-&gt;get_feed_domain() == &#39;twitter.com&#39;): ?&gt;
        	&lt;p class=&quot;site_info&quot; style=&quot;background: url(&lt;?php echo $item-&gt;get_feed_icon()?&gt;) 3px center no-repeat&quot;&gt;&amp;nbsp;&lt;/p&gt;

        	&lt;div class=&quot;item_inner&quot;&gt;
        	&lt;p class=&quot;twitter_user&quot;&gt;&lt;a href=&quot;&lt;?php echo $this-&gt;config-&gt;item(&#39;base_url&#39;)?&gt;items/site/&lt;?php echo $item-&gt;get_feed_domain()?&gt;&quot;&gt;&lt;/a&gt;&lt;/p&gt;
        	&lt;p class=&quot;twitter_tweet&quot;&gt;&lt;?php echo $item-&gt;get_title()?&gt;&lt;/p&gt;
        	&lt;/div&gt;

			&lt;!-- SOURCE WAS: StumbleUpon --&gt;
        	&lt;?php elseif ($item-&gt;get_feed_domain() == &#39;chriscoyier.stumbleupon.com&#39;): ?&gt;
        	&lt;p class=&quot;site_info&quot; style=&quot;background: url(http://www.stumbleupon.com/favicon.ico) 3px center no-repeat&quot;&gt;&amp;nbsp;&lt;/p&gt;
        	&lt;div class=&quot;item_inner&quot;&gt;
        	&lt;div class=&quot;inner_container&quot;&gt;
        	&lt;p class=&quot;digg_title&quot;&gt;&lt;a href=&quot;&lt;?php echo $item-&gt;get_permalink()?&gt;/&lt;?php echo $item-&gt;get_name()?&gt;&quot;&gt;&lt;?php echo $item-&gt;get_title()?&gt;&lt;/a&gt;&lt;/p&gt;
        	&lt;p&gt;&lt;?php echo word_limiter(strip_tags($item-&gt;get_content()), 38)?&gt;&lt;/p&gt;
        	&lt;/div&gt;

			&lt;!-- SOURCE WAS: Sweetcron (manual blog entry) --&gt;
        	&lt;?php elseif (!$item-&gt;feed_id): ?&gt;
        	&lt;div class=&quot;inner_container&quot;&gt;
        	&lt;p class=&quot;blog_title&quot;&gt;&lt;a href=&quot;&lt;?php echo $item-&gt;get_permalink()?&gt;/&lt;?php echo $item-&gt;get_name()?&gt;&quot;&gt;&lt;?php echo $item-&gt;get_title()?&gt;&lt;/a&gt;&lt;/p&gt;
        	&lt;p class=&quot;blog_cite&quot;&gt;A blog post&lt;/p&gt;
        	&lt;/div&gt;

			&lt;!-- SOURCE WAS: Generic Catch-All --&gt;
        	&lt;?php else: ?&gt;
        	&lt;div class=&quot;inner_container instructions&quot;&gt;
        		&lt;p&gt;You don&#39;t have anything set up for this!&lt;/p&gt;
        	&lt;/div&gt;

        	&lt;?php endif; ?&gt;

        	&lt;p class=&quot;date&quot;&gt;&lt;?php echo $item-&gt;get_human_date()?&gt; | &lt;a href=&quot;&lt;?php echo $item-&gt;get_permalink()?&gt;/&lt;?php echo $item-&gt;get_name()?&gt;&quot;&gt;Comments &amp;raquo;&lt;/a&gt;&lt;/p&gt;

        &lt;/li&gt;

    &lt;?php $i  ; endforeach; endif; ?&gt;
&lt;/ul&gt;
</pre>
<p>To create new custom treatments for posts from different sources, just copy and paste one of the PHP elseif statements from above and customize it. On my site, I am including my Twitter feed, StumbleUpon feed, Flickr feed, and the feeds for CSS-Tricks and my personal blog. I created special elseif statements for each of these sources, in case I want to do special styling for any of them.</p>
<p>This came in quite handy. Sweetcron provides a built in function for snagging favicons of the source, which worked for everything except StumbleUpon who&#8217;s subdomains (chriscoyier.stumbleupon.com) prevent that from working. So because I had complete control over how that type of post is displayed, I simply told it to look in the right place manually (see StumbleUpon code above).</p>
<p>Here is what my custom theme looks like:</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/079_lifeStream/tutimages/sweetcron-tut-6.jpg" border="0" /></div>
<p>It is extremely simple. It simply lists the first line of the content of any given post. In the case of Twitter, it&#8217;s the tweet itself. In the case of StumbleUpon, it&#8217;s the link. In the case of CSS-Tricks, it&#8217;s the title of the post. Each post shows its source by the favicon in the margin of the page.</p>
<h3>Step 7: Single Page &amp; Static Pages</h3>
<p>Each blog post of yours will have a permalink as well, A.K.A, a &#8220;single&#8221; page. If you want to add comments to your site, this is the place to do it (single.php). Commenting isn&#8217;t a built-in feature of Sweetcron, but it is simple enough to add with powerful easy-to-use systems like <a href="http://disqus.com/">Disqus</a>. In my theme, I used the dead-simple <a href="http://js-kit.com/">JS-Kit</a> to add comments to my single pages (literally two lines of code).</p>
<p>If you want non-templated &#8220;static&#8221; pages for your site (like a Contact page), that is easy to do as well. Simply create a page called something like &#8220;contact_chris.php&#8221; in your theme directory, and that page will be available at http://your-site.com/sweetcron/contact_chris and the page title will automatically be &#8220;Contact Chris&#8221;. Keep in mind the header and footer files will be automatically applied here, so you are just creating the main content area.</p>
<h3>Wrapping Up</h3>
<p>Our lives on the web are more scattered about now than they ever have been, but thanks to generous API&#8217;s, open formats like RSS, and awesome software like Sweetcron, the personal website is not dead!</p>
<p>Sweetcron is a relatively new software, but its ease of use, great user interface and extensibility are surely going to be help it take off. I could see it amassing a huge user base and even stealing a little market share away from blogging giants like WordPress.</p>
]]></content:encoded>
			<wfw:commentRss>http://net.tutsplus.com/tutorials/site-builds/building-a-custom-lifestream-website-with-sweetcron/feed/</wfw:commentRss>
		<slash:comments>117</slash:comments>
		</item>
		<item>
		<title>How to Create a Mobile Site with MoFuse</title>
		<link>http://net.tutsplus.com/tutorials/site-builds/how-to-create-a-mobile-site-with-mofuse/</link>
		<comments>http://net.tutsplus.com/tutorials/site-builds/how-to-create-a-mobile-site-with-mofuse/#comments</comments>
		<pubDate>Mon, 01 Sep 2008 12:34:26 +0000</pubDate>
		<dc:creator>Thord Hedengren</dc:creator>
				<category><![CDATA[Site Builds]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[mofuse]]></category>

		<guid isPermaLink="false">http://nettuts.com/?p=592</guid>
		<description><![CDATA[<img src="http://nettuts.s3.amazonaws.com/059_Mofuse/200x200.png" alt="MoFuse" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://mofuse.com">MoFuse</a> is a service that lets you convert basically any site with a RSS feed, to a mobile site hosted by MoFuse. You can customize the design, setup your very own domain, and even add advertising to the mobile version of your site. This is a great option if you don&#8217;t feel comfortable hosting your mobile site yourself. And the best part is, MoFuse supports both traditional mobile phones, and the iPhone, which is really cool. <span id="more-592"></span></p>
<h3>Getting Started</h3>
<p>It is actually very simple to get your site setup with MoFuse. Just fill out the URL to your blog (or whatever), and let MoFuse detect it, on the front page. For our example, I&#8217;ll add a mobile version to <a href="http://tdhedengren.com">my own site</a>, and then I&#8217;ll customize it somewhat.</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/059_Mofuse/setup1.jpg" alt="Setup" /></div>
<p>In the second step you&#8217;ll have to choose an URL for your mobile site, hosted under the mofuse.com domain. Mine is <a href="http://<a href="http://tdhedengren.mofuse.mobi">tdhedengren.mofuse.mobi</a>&#8220;><a href="http://tdhedengren.mofuse.mobi">tdhedengren.mofuse.mobi</a></a>, which will work when I&#8217;ve finished setting up my mobile site. You&#8217;ll also get to pick a category for your mobile site, and play with a dummy version if you will.</p>
<p>If you haven&#8217;t used MoFuse before, you&#8217;ll be prompted to setup a user account as well. However, if you have, you should do the setup process from within the MoFuse Dashboard (i.e. you need to login first, click Launch a Mobile Site in the left menu). It is basically the same thing, however, so no worries.</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/059_Mofuse/setup2.jpg" alt="Setup" /></div>
<p>Not very difficult, was it?</p>
<h3>Customizing the Mobile Site</h3>
<p>If you&#8217;re happy with the default look of you mobile site, you can skip the customization, however, I do encourage you to at least change the colors to match your current design, and possibly add a logo if you&#8217;ve got one. This is how my mobile site looks per default:</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/059_Mofuse/aftersetup.jpg" alt="After The Setup" /></div>
<p>It looks decent enough, however, nothing spectacular. I want to carry my brand with me to the mobile screens as well, so let&#8217;s make it a little more tdhedengren.com, shall we? First of all, login to your MoFuse Dashboard, and click the site you want to edit. Starting with colors, click Design/Colors in the right column menu within. This will take us to a straight-forward page where you can edit background, header text, header background, text, and link color by entering HEX values in the boxes, or just click them to choose the color you want from the palette.</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/059_Mofuse/editcolors.jpg" alt="Edit Colors" /></div>
<p>You can find your colors in your CSS file. I edited mine to go with the style on tdhedengren.com, clicked the Save button, and then clicked the Upload Logo link, which is also available to the right but called Your Logo instead.</p>
<p>My logo is simple. I created a 200 pixel wide one, but added some extra whitespace in the file to the top, since I want to avoid having it &#8220;hit&#8221; the top header, where my mobile site&#8217;s name is displayed. You&#8217;ll probably want to play a bit with that, but I went with 10 pixels extra whitespace above my actual logo.</p>
<p>Upload you logo, and then go back to the Design/Colors page. Now you&#8217;ll have options for header background color behind the logo, logo alignment, and of course if you want to show it at all. Edit accordingly, use the &#8220;refresh preview&#8221; link in the dummy preview below the actual settings, and click Save when you&#8217;re done. Now it looks like this:</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/059_Mofuse/aftercustom.jpg" alt="After Custom" /></div>
<h3>Tweaking and Monetizing</h3>
<p>We&#8217;re pretty much good to go now, but I&#8217;d like to tweak my site a little bit more. With my mobile site selected (i.e. clicked) in the MoFuse Dashboard, I click on Edit Homepage in the right column. This will let me write a little something to add under the header of my mobile site, or even on every mobile page should I want to. You get a simple WYISWYG editor to play with. Keep in mind that a lot of text will push down the links to the actual content, so keep it short. I just went with my standard catch-phrase &#8220;designer, writer, blogger&#8221; on the front page.</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/059_Mofuse/edithomepage.jpg" alt="Edit Home Page" /></div>
<p>You can even add new pages, exclusive to your mobile site. Just click Add a New Page in the right column, and you get something similar to the Edit Homepage page. There are a bunch of more or less interesting add-ons for you to incorporate, play around if you will. I especially like the QR code, which might not be working across the world. It is basically an image you can print or whatever, and when someone takes a picture of it with their mobile camera, they&#8217;ll be directed to your mobile site. Nifty!</p>
<p>You might want to add a 57&#215;57 pixel webclip icon for the iPhone and iPod touch. Click iPhone Settings in the right column, a wee bit down, and provide an URL to the icon file. You can turn on and off the iPhone version of your mobile site here as well, but why you&#8217;d want it off is beyond me.</p>
<p>One of the more interesting one is the Monetize option. This will let you embed ads on your mobile site, just by entering some details for either Google Adsense, or AdMob. Then you&#8217;re good to go. Mobile ads will probably not be a heavy hitter for you, but still, it might be something. For myself, I&#8217;ll leave it off, my site isn&#8217;t about ad dollars, and even if it were, I tend to look at mobile sites as a way to prolong the brand and, hopefully, get a faithful visitor on the traditional website as well.</p>
<p><
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/059_Mofuse/monetize.jpg" alt="Monetize" /></div>
<p>Finally, you might want to redirect visitors using mobile devices to your mobile site, automatically. Click Automatic Redirect to the right, and fetch the PHP code to paste it according to the instructions. However, this code is experimental, but as far as I can tell it really shouldn&#8217;t harm or slow down your site much. Tests with it worked too, but use at your own risk, of course.</p>
<h3>Setting Up Your Own Domain</h3>
<p>I&#8217;m not happy with having <a href="http://tdhedengren.mofuse.mobi">tdhedengren.mofuse.mobi</a> as my mobile URL. It is too long, and it doesn&#8217;t really work wonders for my brand. I want <a href="http://m.tdhedengren.com">m.tdhedengren.com</a> to lead to the mobile site, which is something of a standard solution for traditional websites having a mobile version: Put it on a subdomain, preferably <em>m</em> (short) but <em>mobile</em> is pretty common too.</p>
<p>You&#8217;ll need access to DNS records to pull this one off, which means that you&#8217;ll probably have to be hosting your own site (although some creative redirects might be able to solve this as well). Managing DNS records isn&#8217;t something most of us do, so you might want to talk to your webhost about this. Remember, screwing up the DNS means that your site won&#8217;t be working, and I&#8217;m not talking about just your mobile one, your main site might be affected as well. <strong>Proceed with caution!</strong></p>
<p>Since I&#8217;m a madman, I&#8217;ll give it a go anyway. First of all, let&#8217;s click Custom Domain in the right hand menu, at the top. All you need to do there is to enter your custom domain, mine being <a href="http://m.tdhedengren.com">m.tdhedengren.com</a>, and click Save. This won&#8217;t point the domain in question to MoFuse and your mobile site, but it will let MoFuse know that it should expect it.</p>
<p>Now let&#8217;s point the subdomain, <a href="http://m.tdhedengren.com">m.tdhedengren.com</a>, to the mobile site. This is when it gets dangerous, since you&#8217;ll need to make a DNS entry for the subdomain. What you want to add is a CNAME entry for m, pointing to your MoFuse address, mine being <a href="http://tdhedengren.mofuse.mobi">tdhedengren.mofuse.mobi</a>. Various DNS managers look and work in different ways, and my current host needed me to send in a support ticket to make the CNAME entry. Another host I&#8217;ve got access to, however, have a DNS manager that looks like this:</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/059_Mofuse/dnsedit.jpg" alt="DNS Edit" /></div>
<p>Please note the <em>m CNAME pakten.mofuse.mobi</em> part, which is the <a href="http://m.pakten.se">m.pakten.se</a>  subdomain pointing to <a href="http://pakten.mofuse.mobi">pakten.mofuse.mobi</a>.</p>
<p>Save, and then wait. It will take up to 48 hours for a DNS entry to go through across the world, although you&#8217;ll probably see result faster than that.</p>
<p>If you don&#8217;t want to fiddle with the DNS, you could do a subdomain redirect to your MoFuse URL. That would mean that anyone using your subdomain would be sent to your MoFuse URL, which is almost as good. Most webhosts offer subdomain redirects like this, so that shouldn&#8217;t be a problem to setup. You could also use the PHP script mentioned above to check what kind of device that are visiting your site, and serve the mobile version when appropriate that way</p>
<p>Welcome to the mobile web!</p>
<ul class="webroundup">
<li>Subscribe to the <a href="http://feeds.feedburner.com/nettuts" title="NETTUTS RSS Feed">NETTUTS RSS Feed</a> for more daily web development tuts and articles.</li>
</ul>
<p>
<script type="text/javascript"><!--digg_url = "post permalink (not digg url)"; // -->
</script><br />
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://net.tutsplus.com/tutorials/site-builds/how-to-create-a-mobile-site-with-mofuse/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>From PSD to HTML, Building a Set of Website Designs Step by Step</title>
		<link>http://net.tutsplus.com/tutorials/site-builds/from-psd-to-html-building-a-set-of-website-designs-step-by-step/</link>
		<comments>http://net.tutsplus.com/tutorials/site-builds/from-psd-to-html-building-a-set-of-website-designs-step-by-step/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 13:10:05 +0000</pubDate>
		<dc:creator>Collis Ta'eed</dc:creator>
				<category><![CDATA[Site Builds]]></category>

		<guid isPermaLink="false">http://nettuts.com/?p=37</guid>
		<description><![CDATA[<img src="http://psdtuts.s3.amazonaws.com/99_Creatif/200.jpg">]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;m going to take you through my entire process of getting from Photoshop to completed HTML. We&#8217;re going to build out a set of 4 PSD mockups of a website that eventually will become a WordPress theme.  It&#8217;s a massive tutorial, so if you&#8217;re going to follow through to the end, make sure you have a few hours to spare!</p>
<p>  <span id="more-37"></span></p>
<div class="tutorial_image">
<a href="http://nettuts.s3.amazonaws.com/017_Creatif/Site_Download.zip"><br />
<img src="http://nettuts.com/wp-content/themes/nettuts/site_images/button_src_nm.jpg"></a><br />
<a href="http://nettuts.s3.amazonaws.com/017_Creatif/Site/index.html"><br />
<img src="http://nettuts.com/wp-content/themes/nettuts/site_images/button_demo_nm.jpg"></a>
</div>
<h3>Demos</h3>
<p>If you&#8217;re like me, you like to see the end before beginning.  You can see the final four HTML files by following these links:</p>
<ol>
<li><a href="http://nettuts.s3.amazonaws.com/017_Creatif/Site/index.html">Portfolio Home</a></li>
<li><a href="http://nettuts.s3.amazonaws.com/017_Creatif/Site/blog.html">Blog Home</a></li>
<li><a href="http://nettuts.s3.amazonaws.com/017_Creatif/Site/page.html">General Purpose Page</a></li>
<li><a href="http://nettuts.s3.amazonaws.com/017_Creatif/Site/index_alternate.html">Alternate Colour Scheme</a></li>
</ol>
<h3>Download the Files</h3>
<p>Additionally you can <a href="http://nettuts.s3.amazonaws.com/017_Creatif/Site_Download.zip">download the full HTML/CSS/Image source files here</a>.</p>
<h3>What We&#8217;re Building</h3>
<p>As you may or may not know, I&#8217;ve (very slowly) writing a book on WordPress theming. What we&#8217;re building is actually the HTML that I&#8217;m using in the book to build the main example themes. The final set of themes is called Creatif. You can see the 4 mockups shown in screenshots below (click to get the larger versions).</p>
<p>You can get the <a href="http://psdtuts.com/news/new-plus-tutorial-designing-a-family-of-websites/">full layered PSD files *and* a tutorial on designing them up</a> from our PSDTUTS Plus membership &#8211; but it will cost you $9 a month to access. If you don&#8217;t wish to join though, don&#8217;t worry because you can follow today&#8217;s tutorial completely just using the JPG screenshots below.</p>
<div class="tutorial_image"><a target="_blank" href="http://psdtuts.s3.amazonaws.com/99_Creatif/2_large.jpg"><img src="http://psdtuts.s3.amazonaws.com/99_Creatif/2.jpg"  /></a></div>
<div class="tutorial_image"><a target="_blank" href="http://psdtuts.s3.amazonaws.com/99_Creatif/3_large.jpg"><img src="http://psdtuts.s3.amazonaws.com/99_Creatif/3.jpg"  /></a></div>
<div class="tutorial_image"><a target="_blank" href="http://psdtuts.s3.amazonaws.com/99_Creatif/4_large.jpg"><img src="http://psdtuts.s3.amazonaws.com/99_Creatif/4.jpg"  /></a></div>
<div class="tutorial_image"><a target="_blank"  href="http://psdtuts.s3.amazonaws.com/99_Creatif/5_large.jpg"><img src="http://psdtuts.s3.amazonaws.com/99_Creatif/5.jpg"  /></a></div>
<h2>Part 1 &#8211; Building the Framework and First Page</h2>
<p>Unlike previous <a href="http://nettuts.com/category/site-builds/">Site Builds</a> this tutorial is covering a decent sized template. So we&#8217;re going to take this in stages. First we&#8217;ll do the framework, then the first page, then alternate pages, then finally an alternate colour scheme.</p>
<h3>Step 1 &#8211; Getting Ready</h3>
<p>So first of all we boot up our code editor of choice. I actually use Dreamweaver most of the time (and Textmate sometimes). I find it has some pretty decent code tools and a few features that I&#8217;m really used to (in particular a powerful Find+Replace and a quick &lt;img&gt; hook up). If you do use Dreamweaver, I recommend setting up a &quot;Site&quot;.</p>
<p>In any case the first things to do are create a directory structure and get ready to build. I usually have an /images/ directory and a /scripts/ directory, and then plonk all my CSS and HTML in the root.</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/1.jpg" /></div>
<h3>Step 2 &#8211; Quick Early Layout</h3>
<p>The first thing we&#8217;ll do is a quick overall layout in HTML with some barebones CSS just to make sure we&#8217;ve got a solid foundation. We can also check it in the major browsers (IE7, IE6, Firefox, Safari) just to make sure we&#8217;re on a solid footing. There is nothing worse than coming back all the way to the beginning to fix browser compatibility issues. It&#8217;s much better to do it as you go.</p>
<p>So we&#8217;re building the first mockup, we can see a few things:</p>
<ol>
<li>The design is centred. That immediately tells us we have to wrap it in a container and then centre that container.</li>
<li>Essentially the design is a series of horizontal blocks. Sometimes the blocks have two columns, sometimes one. So we can do it as a series of &lt;div&gt;&#8217;s. This is good because we can then mix and match elements into different pages as you&#8217;ll see later.</li>
<li>We have a footer which is a different colour. This means the background needs to be that colour, in case the users browser stretches. So the footer will need to sit in a different container to the main stuff.</li>
</ol>
<p>So here&#8217;s a HTML layout:</p>
<pre name="code" class="html">

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
&lt;html xmlns="http://www.w3.org/1999/xhtml">
&lt;head>
    &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    &lt;title>Creatif&lt;/title>
    &lt;link href="style.css" rel="stylesheet" type="text/css" />

&lt;/head>

&lt;body>
    &lt;div id="main">

    	&lt;div class="container">

        	&lt;div id="header">

            	Logo / Menu

            &lt;/div>

            &lt;div id="block_feature">

            	Featured Content

            &lt;/div>

            &lt;div id="block_content">

            	Content

            &lt;/div>

        &lt;/div>

    &lt;/div>

    &lt;div id="footer">

    	&lt;div class="container">

        	Footer Stuff Goes in Here

        &lt;/div>

    &lt;/div>
&lt;/body>
&lt;/html>
</pre>
<p>As you can see there are two segments: the <strong>#main</strong> area and the <strong>#footer</strong> area. Inside each we have a <strong>&lt;div class=&quot;container&quot;&gt;</strong> element which will be fixed width and centred. Then inside the main container we just have a sequence of &lt;div&gt;&#8217;s. Now let&#8217;s add a little CSS as follows:</p>
<pre name="code" class="css">

body {
	margin:0px; padding:0px;
	background-color:#131211;
}

#main {
	background-color:#c4c0be;
}
#footer {
	color:white;
}
.container {
	width:950px;
	margin:0 auto;
	border:1px solid red;
}
</pre>
<p>So we&#8217;re setting the body&#8217;s background colour to the dark brown of the footer. Then the #main area has the lighter background. Finally you can see the .container elements have a width of 950px and are centred using margin: auto. I&#8217;ve also added a red border just so you can see where the elements are on the page. </p>
<p><a href="http://nettuts.s3.amazonaws.com/017_Creatif/Site/setup.html">You can see the layout here</a>, or view the screenshot below.</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/2.jpg" /></div>
<h3>Step 3 &#8211; Add Some Background Images</h3>
<p>So our layout is looking ship shape. With the main elements positioned, it&#8217;s just a matter of going through and styling it all up, couldn&#8217;t be easier <img src='http://net.tutsplus.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>The first thing we need are some images. You can make these yourself if you have the layered PSD&#8217;s, or just grab the <a href="http://nettuts.s3.amazonaws.com/017_Creatif/Site_Download.zip">download ZIP</a> and you&#8217;ll find some I made earlier!</p>
<p>Here&#8217;s a screenshot of me saving the first image &#8211; a large background JPG. I&#8217;m using this large background image to get that radial gradient highlight, then I&#8217;ll use a thin 1px slice to fill out the left and right sides so it extends off.</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/3.jpg" /></div>
<p>Similarly we&#8217;ll create a background image for the footer to tile along as a border between it and the main area (you can find that image in the ZIP file, it&#8217;s called background_footer.jpg). Now we&#8217;ll update the CSS file to remove that red border and add our new background images, as follows:</p>
<pre name="code" class="css">
@charset "UTF-8";
/* Background-Styles */

body {
	margin:0px; padding:0px;
	background-color:#131211;
}
#main {
	background:#c4c0be url(images/background_light_slice.jpg) repeat-x;
}
#main .container {
	background-image:url(images/background_light.jpg);
	background-repeat:no-repeat;
	min-height:400px;
}
#footer {
	background-image:url(images/background_footer.jpg);
	background-repeat:repeat-x;
	color:white;
	padding:40px;
}
.container {
	width:950px;
	margin:0 auto;
  	position:relative;
}
</pre>
<p>Two things to note:</p>
<ol>
<li>There are multiple ways to set a background. In #main I&#8217;ve used a single selector which sets three properties &#8211; colour, image, image repeat. But you can also set each property individually as I&#8217;ve done in #main .container and #footer.</li>
<li>Notice that because I want to apply the &quot;background_light.jpg&quot; image to the &lt;div class=&#8217;container&#8217;&gt; which inside #main, but<em> not</em> to the one that is inside #footer, I&#8217;ve written #main .container. In other words, apply it only to elements with the class=&#8217;container&#8217; that are inside elements with id=&#8217;main&#8217;.</li>
</ol>
<h3>Step 4 &#8211; Testing in Browsers</h3>
<p>So far so good. Don&#8217;t forget to test in different browsers. Here you can see in IE7 it&#8217;s looking fine and dandy!</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/4.jpg" /></div>
<h3>Step 5 &#8211; Making a Transparent Logo</h3>
<p>Next I&#8217;ve created the logo element. Because later on we&#8217;ll be running an alternate colour scheme I&#8217;m going to use a transparent background PNG file. You can make these by switching off the background in Photoshop and then going to <strong>File &gt; Save for Web and Devices</strong> and selecting <strong>PNG-24</strong>. You should be aware that PNG-24 produces pretty high file sizes. It&#8217;s OK for a small image like this, but for larger ones it can be big. </p>
<p>(If anyone knows how to make compressed PNG files, leave a comment, because I&#8217;m pretty sure there is a way to do it, I just don&#8217;t know how!)</p>
<p>Anyhow you can grab the <a href="http://nettuts.s3.amazonaws.com/017_Creatif/Site/images/logo.png">transparent logo PNG here.</a></p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/5.jpg" /></div>
<p>Now we&#8217;ll add our logo and also a menu with this HTML:</p>
<pre name="code" class="html">
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
&lt;html xmlns="http://www.w3.org/1999/xhtml">
&lt;head>
    &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    &lt;title>Creatif&lt;/title>
    &lt;link href="step_2.css" rel="stylesheet" type="text/css" />
    &lt;link rel="shortcut icon" href="images/favicon.ico" />
&lt;/head>

&lt;body>
    &lt;div id="main">
    	&lt;div class="container">

        	&lt;div id="header">

            	&lt;ul id="menu">
                	&lt;li>&lt;a href="">Portfolio&lt;/a>&lt;/li>
                	&lt;li>&lt;a href="">Services&lt;/a>&lt;/li>
                	&lt;li>&lt;a href="">About&lt;/a>&lt;/li>
                	&lt;li>&lt;a href="">Testimonials&lt;/a>&lt;/li>
                	&lt;li>&lt;a href="">Request a Quote&lt;/a>&lt;/li>
                &lt;/ul>

            	&lt;div id="logo">
                	&lt;h1>Creatif&lt;/h1>
                    &lt;small>A Family of Rockstar Wordpress Themes&lt;/small>
                &lt;/div>

            &lt;/div>

            &lt;div id="block_feature">

            	Featured Content

            &lt;/div>

            &lt;div id="block_content">

            	Content

            &lt;/div>

        &lt;/div>
    &lt;/div>

    &lt;div id="footer">
    	&lt;div class="container">

        	Footer Stuff Goes in Here

        &lt;/div>
    &lt;/div>
&lt;/body>
&lt;/html>
</pre>
<p>and this extra CSS:</p>
<pre name="code" class="css">

#header {
	padding-top:20px;
}
#logo h1, #logo small {
	margin:0px;
	display:block;
	text-indent:-9999px;
}
#logo {
	background-image:url(images/logo.png);
	background-repeat:no-repeat;
	width:194px;
	height:83px;
}
ul#menu {
	margin:0px; padding:0px;
	position:absolute;
	right:0px;
}
ul#menu li {
	display:inline;
}
</pre>
<p>Some things to note:</p>
<ol>
<li>Rather than just placing the logo image in the HTML, we&#8217;ve created a &lt;div id=&quot;logo&quot;&gt; and inside that placed a &lt;h1&gt; with the title. Then using CSS we&#8217;ve made the text vanish and swapped it for the logo image. This has some SEO benefits.</li>
<li>I used to just set the text to display:hidden, but a kind commenter on a previous tutorial pointed out that this is a bad practice and it&#8217;s better to use text-indent. So as you can see I *do* read my comments <img src='http://net.tutsplus.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
<li>I&#8217;ve placed a very quick, unstyled menu using an unordered list. By setting the display property to inline for the &lt;li&gt; elements, the list changes to a horizontal set of elements &#8230; yay!</li>
<li>Finally because our &lt;div class=&quot;container&quot;&gt; element has position:relative, we can now use absolute positioning <em>inside</em> and set right:0px for the menu and it will be aligned to the right. This is great for a WordPress theme because as the person creates new pages the menu will extend, and this way it will stay right aligned.</li>
</ol>
<h3>Step 6 &#8211; Fixing Transparency in IE6</h3>
<p>Now the one problem with transparent PNGs is that our friend Internet Explorer 6 doesn&#8217;t support them! Fortunately that&#8217;s relatively easily fixed thanks to this article I found &#8211; <a href="http://bjorkoy.com/past/2007/4/8/the_easiest_way_to_png/">The Easiest Way to Fix PNG for IE6</a>. We just download a script and add this line in our CSS:
</p>
<pre name="code" class="css">
/* Fix up IE6 PNG Support */
img, #logo { behavior: url(scripts/iepngfix.htc); }
</pre>
<p>Unfortunately for me though my testing copy of IE6 which because I&#8217;m on a Mac is through Darwine &#8211; doesn&#8217;t recognize the fix &#8230; So I have no idea if my hack is working <img src='http://net.tutsplus.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </p>
<p>So anyhow at this point I stopped paying attention to IE6 <img src='http://net.tutsplus.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   I&#8217;m going to have to get me yet another way to view IE6, maybe through parallels. </p>
<p>In any case, here&#8217;s a screenshot of what we get in IE6 when transparency is *not* working&#8230;</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/6.jpg" /></div>
<h3>Step 7 &#8211; Fixing up the Menu</h3>
<p>Now our menu is still looking pretty ugly, so let&#8217;s add a few styles to finish it off, as follows:</p>
<pre name='code' class="css">
ul#menu {
	margin:0px; padding:0px;
	position:absolute;
	right:0px;
}
ul#menu li {
	display:inline;
	margin-left:12px;
}
ul#menu li a {
	text-decoration:none;
	color:#716d6a;
	font-family:Verdana, Arial, Helvetica, sans-serif;
	font-size:10px;
	font-weight:bold;
	text-transform:uppercase;
}
ul#menu li a.active, ul#menu li a:hover {
	color:#211e1e;
}</pre>
<p>Nothing very exciting here except that we&#8217;ve defined an &quot;active&quot; style which is the same as the :hover style (namely it&#8217;s a darker shade). That means we can write &lt;a href=&quot;&quot; class=&quot;active&quot;&gt; and the link will darken. Later in WordPress we&#8217;ll make it so that you can tell what page you are on at any given time.</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/7.jpg" /></div>
<h3>Step 8 &#8211; Adding the Featured Portfolio Item Content</h3>
<p>Now we have the base of our page laid out, it&#8217;s time to start adding the content blocks. As I mentioned earlier we are going to make this site as a series of interchangeable content blocks. The first one is the &quot;Featured Project&quot; block. So let&#8217;s add some HTML:</p>
<pre name="code" class="html">
            &lt;div id=&quot;block_featured&quot; class="block">
            	&lt;span class="block_inside">

                	&lt;div class="image_block">
                    	&lt;img src="images/sample_feature.jpg" />
                    &lt;/div>
                    &lt;div class="text_block">
                        &lt;h2>Eden Website Design&lt;/h2>
                        &lt;small>in &lt;a href="">web design&lt;/a> tagged &lt;a href="">corporate&lt;/a>, &lt;a href="">web2&lt;/a>&lt;/small>

                        &lt;p>And then a short description of the website would go in here.  Something saying maybe what awesome skills I used on the project and how happy the client was. &lt;/p>
                        &lt;br />
                        &lt;a href="" class="button">View Project&lt;/a>
                	&lt;/div>

                &lt;/span>
            &lt;/div>
</pre>
<p>So that code goes below the &lt;div id=&quot;header&quot;&gt;&lt;/div&gt; code from the previous steps. And unstyled it looks like this:</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/8.jpg" /></div>
<p>There are two important things to note here:</p>
<ol>
<li>You will see that we have a &lt;div class=&quot;block&quot;&gt; followed immediately by a &lt;span class=&quot;block_inside&quot;&gt;. This is because the boxes we are drawing have a double border, first there is a 1px dark grey border, then inside that a 1px white border. So having two elements means we can have a border on each. I don&#8217;t know why I used a &lt;span&gt; on the inside, and as you&#8217;ll see later on we wind up changing it <img src='http://net.tutsplus.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
<li>Where we have the View Project button, instead of using an image, we&#8217;re going to create a &#8216;button&#8217; class and then apply it to regular text links. This makes for a very simple, reusable button look and feel.</li>
</ol>
<h3>Step 9 &#8211; Adding some Basic Styles</h3>
<p>Now we apply some basic styling like this:</p>
<pre name="code" class="css">
/*
	Block-Styles
*/

.block {
	border:1px solid #a3a09e;
	background-color:#ffffff;
	margin-bottom:20px;
}
.block_inside {
	display:block;
	border:1px solid #ffffff;
	background: #ffffff url(images/background_block_slice.jpg) repeat-x;
	padding:30px;
	overflow:auto;
}

.image_block {
	border:1px solid #b5b5b5;
	background-color:#d2d2d2;
	padding:5px;
	float:left;
}
.image_block img {
	border:1px solid #b5b5b5;
}
.text_block {
	float:left;
	width:430px;
	margin-left:30px;
}
</pre>
<p>So as I mentioned above we have the .block class which just sets a border and bottom margin. Then immediately inside we have the .block_inside element which has a white border, thin slice background (to give it that faint gradient), some padding and finally an overflow value.</p>
<p>We have <em>overflow:auto</em> because we are going to have two floated elements inside. I used to use a clearing &lt;div&gt; but someone in my previous comments pointed out that this works just as well and is a lot cleaner!</p>
<p>Then inside we have an .image_block class which gives our image a double border (one on the &lt;div&gt; and one on the &lt;img&gt; itself) and which is floated left with our main .text_block also floated left to form a mini columned layout. </p>
<p>So our layout now looks like this:</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/9.jpg" /></div>
<h3>Step 10 &#8211; Adding Text Styles</h3>
<p>Now the text styling is all over the place at the moment. It sort of looked OK in the previous screenshot because Firefox which I was using has defaulted to a Sans-Serif font. But if I&#8217;d screenshotted IE you would have seen a Serif&#8217;d typeface instead. So we should get the text sorted out now. We&#8217;ll add these bits of CSS to our stylesheet:</p>
<pre name="code" class="css">
body {
	margin:0px; padding:0px;
	background-color:#131211;
	font-family:Arial, Helvetica, sans-serif;
	color:#7f7d78;
	font-size:13px;
	line-height:19px;
}

/*
	Text-Styles
*/

h2 {
	margin:0px 0px 10px 0px;
	font-size:36px;
	font-family:Helvetica, Arial, Sans-serif;
	color:#000000;
}
small {
	color:#595856;
	font-weight:bold;
	font-size:11px;
	display:block;
	margin-bottom:15px;
}
a {
	color:#007de2;
	text-decoration:none;
}
a:hover { text-decoration:underline; }
p { margin: 0px 0px 15px 0px; }

a.button {
	background:#32312f url(images/button_bg.jpg) repeat-x;
	padding:5px 10px 5px 10px;
	color: #ffffff;
	text-decoration: none;
	border:1px solid #32312f;
	text-transform:uppercase;
	font-size:9px;
	line-height:25px;
}
a.button:hover {
	background:#007de2 url(images/button_bg_o.jpg) repeat-x;
	border-color:#007de2;
}
</pre>
<p>So:</p>
<ol>
<li>First I&#8217;ve updated the body tag to have a default font, colour, size and line-height.</li>
<li>Then we&#8217;ve created a &lt;h2&gt; style which fixes the margins and sets the font to Helvetica</li>
<li>We&#8217;ve also created a &lt;small&gt; style for subheadings (like what category a post is in etc)</li>
<li>We&#8217;ve created a link style and link:hover style</li>
<li>We&#8217;ve reset the &lt;p&gt; styling so that the margins are fixed from the stupid defaults</li>
<li>Finally we&#8217;ve created that button class. Note that I&#8217;ve defined it as &quot;a.button&quot;, or in other words all &lt;a&gt; tags with the class = &quot;button&quot;. Why didn&#8217;t I just make it &quot;.button&quot; ? Well later on there is a good chance that I will make a second button class for &lt;input&gt;&#8217;s and it will be slightly different. So this way they won&#8217;t accidentally interact.</li>
<li>In the button class you will see we&#8217;ve set some padding, a border, a background image, a hover style and a line-height attribute &#8230; wait a line-height attribute? Yes unfortunately this is a fix for IE which otherwise cuts off the button. </li>
</ol>
<p>Withour extra styling, the page is starting to take shape!</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/10.jpg" /></div>
<h3>Step 11 &#8211; Adding the Ribbon</h3>
<p>One of the neat things about this design is the little blue ribbon strips in the right corner. Thanks to a mix of CSS, transparent PNG files and absolute positioning, these are really easy to add. So first we need to make the image. Once again we create an image with a transparent background and save it as PNG-24, here&#8217;s the image:</p>
<div class="tutorial_image"><img src="Site/images/ribbon_featured.png" width="149" height="87" /></div>
<p>Next we need to place the image in our HTML, we can do it like this:</p>
<pre name="code" class="html">
			&lt;div class="block">
				&lt;img src="images/ribbon_featured.png" class="ribbon"/>
            	&lt;span class="block_inside">

                	&lt;div class="image_block">
                    	&lt;img src="images/sample_feature.jpg" />
                    &lt;/div>
                    &lt;div class="text_block">
                        &lt;h2>Eden Website Design&lt;/h2>
                        &lt;small>in &lt;a href="">web design&lt;/a> tagged &lt;a href="">corporate&lt;/a>, &lt;a href="">web2&lt;/a>&lt;/small>

                        &lt;p>And then a short description of the website would go in here.  Something saying maybe what awesome skills I used on the project and how happy the client was. &lt;/p>
                        &lt;br />
                        &lt;a href="" class="button">View Project&lt;/a>
                	&lt;/div>

                &lt;/span>
            &lt;/div>
</pre>
<p>So you can see the &lt;img&gt; tag there on the second line.  Note I&#8217;ve given it a class=&#8221;ribbon&#8221; and put it inside the .block element, but <em>outside</em> the .block_inside element. That&#8217;s because if we do it inside .block_inside it messes up the overflow:auto property we set earlier. Anyhow right now this will just mess up our layout, so let&#8217;s add some styling:</p>
<pre name="code" class="css">
.block {
	border:1px solid #a3a09e;
	background-color:#ffffff;
	margin-bottom:20px;
	position:relative;
}
.ribbon {
	position:absolute;
	top:-3px;
	right:-3px;
}
</pre>
<p>You can see that we&#8217;ve:</p>
<ol>
<li>Added a position:relative attribute to the .block element. This is so that we can use absolute positioning inside and have it relative to the .block element (and not the whole page)</li>
<li>Then we&#8217;ve set the image to appear 3px past the right edge and 3px past the top edge. </li>
</ol>
<p>Easy! Back in the day, we would have had to use some super complicated &lt;table&gt; layout to achieve that same effect. Here&#8217;s how it&#8217;s looking now:</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/11.jpg" /></div>
<h3>Step 12 &#8211; Creating the Second Block</h3>
<p>With the ribbon added, our first block element is complete! Now it&#8217;s time to start on the next &lt;div&gt; block. This one will have that text about the theme and the recent projects list. So first we add some HTML:</p>
<pre name="code" class="html">
			&lt;div id="block_portfolio">

            	&lt;div id="portfolio_items">

                	&lt;div class="mini_portfolio_item">
                    	&lt;div class="block_inside">
                            &lt;img src="images/sample_mini_portfolio.jpg" class="thumbnail" alt="PSDTUTS"  />
                            &lt;h3>PSDTUTS Theme Design&lt;/h3>
                            &lt;p>Website design for leading photoshop tutorial site and creation and maintenance of Wordpress theme. &lt;/p>
                            &lt;a href="#" class="button">View Project&lt;/a>
                        &lt;/div>
                    &lt;/div>

                	&lt;div class="mini_portfolio_item">
                    	&lt;div class="block_inside">
                            &lt;img src="images/sample_mini_portfolio.jpg" class="thumbnail" alt="PSDTUTS"  />
                            &lt;h3>PSDTUTS Theme Design&lt;/h3>
                            &lt;p>Website design for leading photoshop tutorial site and creation and maintenance of Wordpress theme. &lt;/p>
                            &lt;a href="#" class="button">View Project&lt;/a>
                        &lt;/div>
                    &lt;/div>

                    &lt;div class="mini_portfolio_item">
                    	&lt;div class="block_inside">
                            &lt;img src="images/sample_mini_portfolio.jpg" class="thumbnail" alt="PSDTUTS"  />
                            &lt;h3>PSDTUTS Theme Design&lt;/h3>
                            &lt;p>Website design for leading photoshop tutorial site and creation and maintenance of Wordpress theme. &lt;/p>
                            &lt;a href="#" class="button">View Project&lt;/a>
                        &lt;/div>
                    &lt;/div>

                &lt;/div>

                &lt;div id="text_column">
                    &lt;h2 id="text_title">Creatif is a WordPress portfolio theme for designers and creatives&lt;/h2>
                    &lt;p>You can use it to quickly turn WordPress into a portfolio website.  Not familiar with WordPress? Fear not, the theme accompanies a book called &lt;a href="#">How to Be a Rockstar Wordpress Designer&lt;/a> by Rockstar Resources due for release in 2008.&lt;/p>
                    &lt;p>The book teaches you to use WordPress theming to take advantage of this flexible CMS product to create dynamic sites.&lt;/p>
                  &lt;p>And as if that’s not enough, you can see a photoshop to HTML tutorial on designing the theme over at &lt;a href="http://psdtuts.com">PSDTUTS&lt;/a> and &lt;a href="http://nettuts.com">NETTUTS&lt;/a>.&lt;/p>
			  &lt;/div>

            &lt;/div></pre>
<p>So that looks like lots of code, but it&#8217;s not really. Let&#8217;s go through it:</p>
<ol>
<li>First we&#8217;ve created a container &lt;div id=&quot;block_portfolio&quot;&gt; to wrap up the code segment</li>
<li>Next we&#8217;ve got a &lt;div id=&quot;portfolio_items&quot;&gt; which contains three identical &lt;div class=&quot;mini_portfolio_item&quot;&gt;&#8217;s. We&#8217;ll talk about these in a second.</li>
<li>Next we have a &lt;div id=&quot;text_column&quot;&gt; which is filled with some text and a &lt;h2&gt; heading.</li>
<li>What we are going to do is float the text column and portfolio items side by side to form two columns of content.</li>
<li>We&#8217;re going to replace that &lt;h2&gt; with a background image.</li>
<li>And we&#8217;ll style up those mini_portfolio_item divs to look nice using a similar double border effect as we did earlier.</li>
</ol>
<p>Here&#8217;s the CSS:</p>
<pre name="code" class="css">
/*
	Portfolio-Home-Styles
*/

#block_portfolio {
	overflow:auto;
	margin-bottom:20px;
}
#portfolio_items {
	width:615px;
	margin-right:25px;
	float:left;

}
#text_column {
	float:right;
	width:310px;
}
#text_column h2#text_title {
	text-indent:-9999px;
	background-image:url(images/creatif.jpg);
	background-repeat:no-repeat;
	width:310px;
	height:129px;
}

.mini_portfolio_item {
	border:1px solid #a3a09e;
	margin-bottom:10px;

}
.mini_portfolio_item .block_inside {
	background:none; background-color:#e2dddc;
	padding:25px 30px 15px 30px;
}
.mini_portfolio_item .thumbnail { float:left; margin-right:20px; border:1px solid #979390; }
</pre>
<p>OK again, looks like a lot, but it&#8217;s not too bad. Let&#8217;s go through it step by step:</p>
<ol>
<li>First we&#8217;ve again used overflow:auto on the main #block_portfolio element. That&#8217;s because we again have two floated columns and if we don&#8217;t do this, they&#8217;ll run over the footer.</li>
<li>Next we&#8217;ve set #portfolio_items to float to the left, have a margin to separate it from the text column and a width of 615px.</li>
<li>The #text_column is set to float to the right with a width of 310px.</li>
<li>Inside the text column we&#8217;ve again done that trickery with our &lt;h2&gt; tag where we use a massive text-indent to make the text disappear and then instead use a background image.</li>
</ol>
<p>Next we have three style definitions for the mini_portfolio_item elements as follows:</p>
<ol>
<li>First we set a 1px dark border and a margin between them</li>
<li>Next we redefine the .block_inside styles to suit these elements. Remember .block_inside was defined earlier when we did the Featured Project area. So here we are overriding the background image, changing the background colour and changing the padding.</li>
<li>Finally we make the thumbnail images float left and have a border.</li>
</ol>
<p>So all in all it&#8217;s looking like this:</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/14.jpg" alt="" /></div>
<h3>Step 13 &#8211; Adding a Ribbon.</h3>
<p>Now we want to add a &quot;Recent Projects&quot; ribbon to the top most item. To do this we simply slot it in, in the same position in the HTML as previously, like this:</p>
<pre name="code" class="html">
					&lt;div class="mini_portfolio_item">
                    	&lt;img src="images/ribbon_recent.png" class="ribbon" alt="Recent Projects"/>
                    	&lt;div class="block_inside">
                            &lt;img src="images/sample_mini_portfolio3.jpg" class="thumbnail" alt="AudioJungle" />
                            &lt;h3>AudioJungle Site Design&lt;/h3>
                            &lt;p>Website design for leading photoshop tutorial site and creation and maintenance of Wordpress theme. &lt;/p>
                            &lt;a href="#" class="button">View Project&lt;/a>
                        &lt;/div>
                    &lt;/div>
</pre>
<p>Then we add a position:relative attribute to the mini_portfolio_item element like this:</p>
<pre name="code" class="css">
.mini_portfolio_item {
	border:1px solid #a3a09e;
	margin-bottom:10px;
	position:relative;
}
</pre>
<p>But something weird happens&#8230; While the right hand side looks correct, the top is getting cut off, as you can see in the screenshot:</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/15.jpg" /></div>
<p>The reason is that the element that our mini_portfolio_item is sitting inside is cutting it off. So we check up and see that the mini_portfolio_item&#8217;s are all inside a &lt;div id=&quot;portfolio_items&quot;&gt;. So the solution is pretty easy, we add 3px of padding to the top which is just enough space for our ribbon to show through. Here&#8217;s the adjusted CSS:</p>
<pre name="code" class="html">
#portfolio_items {
	width:615px;
	margin-right:25px;
	float:left;
	padding-top:3px;
}
</pre>
<h3>Step 14 &#8211; Finishing off the Portfolio Items</h3>
<p>Finally I&#8217;ve swapped in a few images and titles so we can see how the page looks with 3 different items instead of the same one repeated. Then I also decided to get rid of the View Project button and just have a text link. This looked a bit cleaner and less busy. So here&#8217;s the final portfolio items section (shown in Safari, don&#8217;t forget to keep testing in different browsers!):</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/17.jpg" alt="" /></div>
<h3>Step 15 &#8211; Adding Footer Content</h3>
<p>Now there is just one more section to our page: the footer! Let&#8217;s add some text content to it:</p>
<pre name="code" class="html">
	&lt;div id="footer">
    	&lt;div class="container">

        	&lt;div class="footer_column long">
                &lt;h3>Designed by Collis Ta’eed, do with this as you please&lt;/h3>
                &lt;p>You can read a photoshop tutorial for creating the design at &lt;a href="http://psdtuts.com">PSDTUTS&lt;/a>, You can read a PS->HTML tutorial for creating the site at &lt;a href="http://nettuts.com">NETTUTS&lt;/a> and you can learn how to turn the HTML into a Wordpress theme in the upcoming book &lt;a href="http://freelanceswitch.com/book">How to be a Rockstar Wordpress Designer&lt;/a>&lt;/p>
			&lt;/div>

	        &lt;div class="footer_column">
                &lt;h3>More Links&lt;/h3>
				&lt;ul>
                    &lt;li>&lt;a href="http://vectortuts.com">VECTORTUTS&lt;/a>&lt;/li>
            		&lt;li>&lt;a href="http://flashden.net">FlashDen&lt;/a>&lt;/li>
            		&lt;li>&lt;a href="http://audiojungle.net">AudioJungle&lt;/a>&lt;/li>
            		&lt;li>&lt;a href="http://freelanceswitch.com">FreelanceSwitch&lt;/a>&lt;/li>
            		&lt;li>&lt;a href="http://faveup.com">FaveUp&lt;/a>&lt;/li>
                &lt;/ul>
            &lt;/div>

            &lt;div class="footer_column">
                &lt;h3>RSS&lt;/h3>
				&lt;ul>
                    &lt;li>&lt;a href="">RSS Feed&lt;/a>&lt;/li>
            		&lt;li>&lt;a href="">What is RSS?&lt;/a>&lt;/li>
                &lt;/ul>
            &lt;/div>

        &lt;/div>
    &lt;/div></pre>
<p>A few things to note:</p>
<ol>
<li>I&#8217;ve created three &lt;div class=&quot;footer_column&quot;&gt;&#8217;s to house the content of the footer, we&#8217;ll float these into place in a second.</li>
<li>Since the first column is a different width I&#8217;ve given it a second class called &quot;long&quot;. Note that you set two classes like this: class=&quot;class1 class2&quot;, <em>not</em> like this: class=&quot;class1&quot; class=&quot;class2&quot; which is invalid markup.</li>
<li>Inside the columns I&#8217;ve used &lt;ul&gt; lists and &lt;h3&gt; tags for the headings. It&#8217;s always good to use nice semantic markup, both because it makes it more readable, and because search engines like to see those headings and lists all laid out properly.</li>
</ol>
<p>Here&#8217;s how it&#8217;s looking!</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/18.jpg" /></div>
<h3>Step 16 &#8211; Styling the Footer</h3>
<p>Styling the footer is a pretty simple job, here&#8217;s the code we need:</p>
<pre name="code" class="css">
/*
	Footer-Styles
*/

#footer {
	font-family:Verdana, Arial, Helvetica, sans-serif;
	font-size:10px;
}
.footer_column {
	float:left;
	width:120px;
	margin-right:30px;
}
#footer .long {
	width:610px;
}
#footer h3 {
	color:#e2dddc;
	text-transform:uppercase;
	font-size:10px;
}
.footer_column ul li, .footer_column ul {
	list-style:none;
	margin:0px;
	padding:0px;
}
</pre>
<p>Going through:</p>
<ol>
<li>First we set the fonts for the #footer area</li>
<li>Then we set all the columns to float with a default width of 120px</li>
<li>We override this width for the .long column. Notice that I&#8217;ve set &quot;#footer .long&quot; instead of just &quot;.long&quot;. The reason I did this is that &quot;long&quot; is the kind of generic name I might use again later on somewhere else, so it&#8217;s a good idea to specify it more clearly.</li>
<li>Finally the &lt;h3&gt; and &lt;ul&gt; tags get some simple styles</li>
</ol>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/19.jpg" /></div>
<h3>Step 17 &#8211; Adding a Favicon!</h3>
<p>We&#8217;re almost finished our first page. It&#8217;s time to add some niceties.  First a Favicon. These are those little icons that appear in your browser bar. I don&#8217;t need anything fancy, just a little black square with a C for Creatif will do nicely. So first we create a square image like this:</p>
<div class="tutorial_image"><img src="Site/images/favicon.jpg" /></div>
<p>There are lots of sites to make Favicons (<a href="http://sixrevisions.com/resources/favicon_generators_resources/">Visit SixRevisions for a list of them</a>) but I always use <a href="http://www.html-kit.com/favicon/">html-kit&#8217;s</a> for no particular reason. You just upload the image and hit Generate Favicon.ico.</p>
<p>Then we hook it up with this line of HTML:</p>
<pre name="code" class="html">
    &lt;link rel="shortcut icon" href="images/favicon.ico" />
</pre>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/21.jpg" /></div>
<h3>Step 18 &#8211; Validating!</h3>
<p>Now it&#8217;s time to check that our markup is w3c valid! So we go to the <a href="http://validator.w3.org/">Validator</a> put in our code and cross fingers &#8230; and pah-bow <img src='http://net.tutsplus.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  We are <em>not</em> valid. I don&#8217;t think I&#8217;ve ever been valid on the first try actually, I must have some bad habits!</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/22.jpg" /></div>
<p>Looking down there are 14 errors. The number one problem is that there is no alt text on any of my images&#8230; whoops! So going back and adding them like so:</p>
<pre name="code" class="html">
&lt;img src=&quot;images/ribbon_featured.png&quot; class=&quot;ribbon&quot; alt=&quot;Featured Project&quot;/&gt;
</pre>
<p>should fix up lots of the errors. So now we run it again and &#8230; drum roll &#8230; D&#8217;oh! Still invalid. OK this one looks a bit trickier:</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/24.jpg" /></div>
<p>Fortunately the remaining 8 errors are actually the same problem. Basically I&#8217;ve used an inline element (specifically a &lt;span class=&quot;block_inside&quot;&gt;) and then tried to put block level elements like &lt;div&gt;&#8217;s inside. Apparently that&#8217;s not allowed &#8230; whoops!</p>
<p>Luckily that&#8217;s easily fixed, we just change every instance of &lt;span class=&quot;block_inside&quot;&gt; to a &lt;div class=&quot;block_inside&quot;&gt;. And &#8230; YAY! We pass <img src='http://net.tutsplus.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/23.jpg" /></div>
<h3>Finished Part 1!</h3>
<p>OK we have successfully made our basic page! Here you can see me testing it in IE7 and thankfully there are no bugs.</p>
<p><a href="http://nettuts.s3.amazonaws.com/017_Creatif/Site/index.html">Here&#8217;s the completed page</a></p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/25.jpg" /></div>
<h2>Part 2 &#8211; Building the Variations</h2>
<p>With our basic framework in place we are now ready to build the extra pages and the alternate colour scheme. Happily we&#8217;ve lain a good foundation and will be able to make use of a lot of the code we&#8217;ve already written. This is why it&#8217;s really important to plan ahead.</p>
<p>If you don&#8217;t plan you can easily wind up with a lot of duplication, extra code and other folly. </p>
<h3>Step 19 &#8211; Building the Blog Homepage</h3>
<p>The next page we&#8217;re going to build is the blog homepage. This is similar to the portfolio homepage in that it will have a featured blog post and then a series of blog posts below. Eventually these will become two related WordPress themes &#8211; one for portfolios, one for blogs.</p>
<p>So first we duplicate our index.html &#8211; the file we&#8217;ve been working on up &#8217;til now, and call the new file blog.html. </p>
<p>In our blog.html we first delete the whole &lt;div id=&quot;block_portfolio&quot;&gt;. We&#8217;re going to replace that block with a different one shortly. Then we replace the <span class="html">&lt;div id=&quot;block_featured</span>&quot;&gt; with a new block for featured blog posts which is just slightly different and looks like this:</p>
<pre name="code" class="html">
			&lt;div id="block_featuredblog" class="block">
				&lt;img src="images/ribbon_featuredblog.png" class="ribbon" alt="Featured Project"/>
            	&lt;div class="block_inside">

                	&lt;div class="image_block">
                    	&lt;img src="images/sample_blog.jpg" alt="New Blog"/>
                    &lt;/div>
                    &lt;div class="text_block">
                        &lt;h2>New Blog Design Launched&lt;/h2>
                        &lt;small>on &lt;a href="">april 13&lt;/a> in &lt;a href="">web design&lt;/a> tagged &lt;a href="">blogging&lt;/a>&lt;/small>
                        &lt;p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla mi risus, tempor in, gravida quis, rutrum vitae, massa. Suspendisse congue, nibh et lacinia sodales. &lt;/p>
						&lt;p>Risus nulla fringilla enim, sit amet adipiscing sapien risus sed velit. Sed vitae justo. In quis lorem nec justo varius sodales. Nullam eleifend accumsan mi. Nunc at velit. Maecenas velit. &lt;/p>
                        &lt;br />
                        &lt;a href="" class="button">Read More&lt;/a>
                	&lt;/div>

                &lt;/div>
            &lt;/div>
</pre>
<p>So really all I&#8217;ve done is change the id tag to be block_featuredblog, the ribbon image and the content. Essentially though it&#8217;s the same layout. So let&#8217;s take a look and see how it&#8217;s looking:</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/26.jpg" /></div>
<h3>Step 20 &#8211; Adjusting some CSS</h3>
<p>So that pretty much works as is, we&#8217;ll just make a couple of small adjustments to the CSS like this:</p>
<pre name="code" class='css'>

#block_featuredblog .text_block { padding-top:5px; width:490px;}

h2 {
	margin:0px 0px 10px 0px;
	font-size:36px;
	font-family:Helvetica, Arial, Sans-serif;
	color:#000000;
	line-height:39px;
	letter-spacing:-1px;
}
</pre>
<p>Here I&#8217;ve adjusted the &quot;text_block&quot; class but only when it&#8217;s in the #block_featuredblog element. It now has a tiny bit of padding at the top and is wider.</p>
<p>Also I&#8217;ve added an appropriate line-height to the heading and on a whim adjusted the text kerning by -1px. And we&#8217;re finished with this element! Easy peasy!</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/27.jpg" /></div>
<h3>Step 21 &#8211; Making the Main Content Area</h3>
<p>Making this content area  is the last big thing we need to do really. It will form not only the bottom of this page, but also the whole basis of the generic page (with some adjustments of course!). So first let&#8217;s put in some really basic HTML:</p>
<pre name="code" class="html">
			&lt;div id="block_content">

            	&lt;div id="content_area" class="block">
                    &lt;div class="block_inside">

						Content

                    &lt;/div>
                 &lt;/div>
                 &lt;div id="sidebar">
                 	&lt;div class="block_inside">

                    	Sidebar Content

                    &lt;/div>
                 &lt;/div>

            &lt;/div>
</pre>
<p>So basically what we&#8217;ve created is a container element &#8211; &lt;div id=&quot;block_content&quot;&gt; and then inside that we&#8217;ve got two blocks which we&#8217;re going to float to either side. You&#8217;ll see I&#8217;m making use of our good old &lt;div class=&quot;block_inside&quot;&gt; elements to add the double border. Here&#8217;s the CSS to make them sit correctly:</p>
<pre name="code" class="css">
/*
	Block-Content-Styles
*/

#block_content {

}
#content_area {
	width:665px;
	float:left;
}
#sidebar {
	float:left;
	width:281px;
	position:relative;
	left:-1px;
	margin-top:15px;
	background-color:#e2dddc;
	border:1px solid #a3a09e;
}
#sidebar .block_inside {
	background:none;
	background-color:#e2dddc;
}
</pre>
<p>Going through the styles:</p>
<ol>
<li>Then we&#8217;ve given the #content_area box and the #sidebar box each a width and a float.</li>
<li>Next I&#8217;ve moved the sidebar to the left by 1px using a position:relative. I did this so that the left border would overlap and it would look like it&#8217;s jutting out.</li>
<li>Additionally I&#8217;ve added a 15px top margin so that the sidebar isn&#8217;t top-aligned. Currently it looks a bit odd, but when we add some content it will look great.</li>
<li>Finally I&#8217;ve redefined the .block_inside in the #sidebar element to override the background image and instead give it that beigey colour for a background.</li>
</ol>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/30.jpg" alt="" /></div>
<h3>Step 22 &#8211; Adding Content</h3>
<p>Now we add some content to our two elements to style:</p>
<pre name="code" class="html">
&lt;div id="block_content">

            	&lt;div id="content_area" class="block">
                    &lt;div class="block_inside">

						&lt;h2>Working on a New Project&lt;/h2>
                        &lt;small>on &lt;a href="">april 13&lt;/a> in &lt;a href="">web design&lt;/a> tagged &lt;a href="">blogging&lt;/a>&lt;/small>
                        &lt;p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla mi risus, tempor in, gravida quis, rutrum vitae, massa. Suspendisse congue, nibh et lacinia sodales. &lt;/p>
						&lt;p>Risus nulla fringilla enim, sit amet adipiscing sapien risus sed velit. Sed vitae justo. In quis lorem nec justo varius sodales. Nullam eleifend accumsan mi. Nunc at velit. Maecenas velit. &lt;a href="#">Read More&lt;/a>&lt;/p>

                        &lt;div class="separator">&lt;/div>

                        &lt;h2>Design Awards!&lt;/h2>
                        &lt;small>on &lt;a href="">april 13&lt;/a> in &lt;a href="">web design&lt;/a> tagged &lt;a href="">blogging&lt;/a>&lt;/small>
                        &lt;p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla mi risus, tempor in, gravida quis, rutrum vitae, massa. Suspendisse congue, nibh et lacinia sodales. &lt;/p>
						&lt;p>Risus nulla fringilla enim, sit amet adipiscing sapien risus sed velit. Sed vitae justo. In quis lorem nec justo varius sodales. Nullam eleifend accumsan mi. Nunc at velit. Maecenas velit. &lt;a href="#">Read More&lt;/a>&lt;/p>

                        &lt;div class="separator">&lt;/div>

                        &lt;h2>This Site is Almost Complete Finally...&lt;/h2>
                        &lt;small>on &lt;a href="">april 13&lt;/a> in &lt;a href="">web design&lt;/a> tagged &lt;a href="">blogging&lt;/a>&lt;/small>
                        &lt;p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla mi risus, tempor in, gravida quis, rutrum vitae, massa. Suspendisse congue, nibh et lacinia sodales. &lt;/p>
						&lt;p>Risus nulla fringilla enim, sit amet adipiscing sapien risus sed velit. Sed vitae justo. In quis lorem nec justo varius sodales. Nullam eleifend accumsan mi. Nunc at velit. Maecenas velit. &lt;a href="#">Read More&lt;/a>&lt;/p>

                    &lt;/div>
                 &lt;/div>
                 &lt;div id="sidebar">
     				&lt;img src="images/ribbon_browse.png" class="ribbon" alt="Featured Project"/>
                 	&lt;div class="block_inside">

                    	&lt;h3>Subscribe&lt;/h3>

                        &lt;ul>
                        	&lt;li>&lt;a href="">RSS Feed&lt;/a>&lt;/li>
                        	&lt;li>&lt;a href="">Email Updates&lt;/a>&lt;/li>
						&lt;/ul>  

                        &lt;h3>Categories&lt;/h3>

                        &lt;ul>
                        	&lt;li>&lt;a href="">News&lt;/a>&lt;/li>
                        	&lt;li>&lt;a href="">Marketing&lt;/a>&lt;/li>
                        	&lt;li>&lt;a href="">General&lt;/a>&lt;/li>
                        	&lt;li>&lt;a href="">Great Sites&lt;/a>&lt;/li>
						&lt;/ul>  

                        &lt;h3>Archives&lt;/h3>

                        &lt;ul>
                        	&lt;li>&lt;a href="">June 2008&lt;/a>&lt;/li>
                        	&lt;li>&lt;a href="">May 2008&lt;/a>&lt;/li>
                        	&lt;li>&lt;a href="">April 2008&lt;/a>&lt;/li>
                        	&lt;li>&lt;a href="">March 2008&lt;/a>&lt;/li>
						&lt;/ul>                            

                    &lt;/div>
                 &lt;/div>

                 &lt;!-- a Clearing DIV to clear the DIV's because overflow:auto doesn't work here -->
                 &lt;div style="clear:both">&lt;/div>

            &lt;/div>
</pre>
<p>OK there are three important things to mention here:</p>
<ol>
<li>First in the content area you&#8217;ll see I&#8217;ve added three dummy blog posts and in between each is an empty &lt;div class=&quot;separator&quot;&gt; that we&#8217;ll style shortly into a thin line with some spacing.</li>
<li>Next we&#8217;ve added a ribbon image to the sidebar in much the same way as previously.</li>
<li>Finally I&#8217;ve used a clearing &lt;div&gt; at the bottom. Now previously in this tutorial I&#8217;ve been using overflow:auto; to deal with floated columns, but when we add the margin-top in the previous step to move the sidebar down it messes with the overflow and creates a scrollbar. So since there may be occasions when the sidebar will be longer than the content box we&#8217;re going to use this method of clearing floating &lt;div&gt;&#8217;s instead. </li>
</ol>
<p>Now we&#8217;ll add some basic styling to fix it all up as follows:</p>
<pre name="code" class="css">
#sidebar h3 {
	font-size:20px;
	line-height:23px;
}
#sidebar ul { margin:10px 0px 30px 0px; padding:0px; }
#sidebar ul li { list-style:none; margin:0px 0px 5px 0px; padding:0px; }
#sidebar ul li a { color:#7f7d78; }
#sidebar ul li a:hover { color:#0172dd; text-decoration:none; }

#content_area h2 { font-size:32px; line-height:31px; }

#content_area .separator {
	border-top:1px solid #e3e3e3;
	margin-top:40px;
	padding-top:40px;
}
</pre>
<p>Two things to note:</p>
<ol>
<li>Formatted the &lt;ul&gt; lists in the sidebar to remove the bullet points and space them out nicely</li>
<li>Created a separator style using margin and padding along with 1px border</li>
</ol>
<p>And that&#8217;s it, our #block_content element is complete! <a href="http://nettuts.s3.amazonaws.com/017_Creatif/Site/blog.html">You can see the working HTML here.</a></p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/34.jpg" alt="" /></div>
<h3>Step 23 &#8211; Making the Generic Page</h3>
<p>Making our final page is a piece of cake now. We just duplicate our blog.html and call it page.html this time. Then remove the featured blog post and alter the HTML of the #block_content area as follows:</p>
<pre name="code" class="html">
		&lt;div id="block_content">

            	&lt;div id="content_area" class="block">
                    &lt;div class="block_inside">

                        &lt;h4>Services&lt;/h4>
    					&lt;h2>Branding&lt;/h2>
                        &lt;br />
                        &lt;p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla mi risus, tempor in, gravida quis, rutrum vitae, massa. Suspendisse congue, nibh et lacinia sodales. &lt;/p>
						&lt;p>Risus nulla fringilla enim, sit amet adipiscing sapien risus sed velit. Sed vitae justo. In quis lorem nec justo varius sodales. Nullam eleifend accumsan mi. Nunc at velit. Maecenas velit. &lt;a href="#">Read More&lt;/a>&lt;/p>

                    &lt;/div>
                 &lt;/div>
                 &lt;div id="sidebar">
     				&lt;img src="images/ribbon_navigation.png" class="ribbon" alt="Featured Project"/>
                 	&lt;div class="block_inside">

                    	&lt;h3>Services&lt;/h3>

                        &lt;ul>
                        	&lt;li>&lt;a href="">Branding&lt;/a>&lt;/li>
                        	&lt;li>&lt;a href="">Graphic Design&lt;/a>&lt;/li>
                        	&lt;li>&lt;a href="">Web Development&lt;/a>&lt;/li>
                        	&lt;li>&lt;a href="">Marketing&lt;/a>&lt;/li>
						&lt;/ul>  

                        &lt;h3>Related Portfolio Items&lt;/h3>

                        &lt;ul>
                        	&lt;li>&lt;a href="">Eden Branding&lt;/a>&lt;/li>
                        	&lt;li>&lt;a href="">FlashDen Logo Design&lt;/a>&lt;/li>
                        	&lt;li>&lt;a href="">PSDTUTS Website&lt;/a>&lt;/li>
						&lt;/ul>  

                    &lt;/div>
                 &lt;/div>

                 &lt;!-- a Clearing DIV to clear the DIV's because overflow:auto doesn't work here -->
                 &lt;div style="clear:both">&lt;/div>

            &lt;/div>
</pre>
<p>Which is pretty much the same HTML as previously just with some different text and a new ribbon. The only real change is that now we have a title and above that a subtitle wrapped in an &lt;h4&gt; tag. So we can style that with a couple of lines of CSS as follows:</p>
<pre name="code" class="css">
h4 {
	color:#007de2;
	margin:0px 0px 0px 0px;
}
</pre>
<p>And that is that!  <a href="http://nettuts.s3.amazonaws.com/017_Creatif/Site/page.html">See the final generic page here</a>.</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/35.jpg" /></div>
<h3>Step 24 &#8211; It don&#8217;t matter if it&#8217;s Black or White!</h3>
<p>Now we&#8217;re going to do some <strong>very</strong> simple CSS to switch the site from light to dark. What&#8217;s neat about this is the only HTML we need to alter is this one line:</p>
<pre name="code" class="html">
&lt;body id="dark">
</pre>
<p>That&#8217;s it! With that one bit of extra HTML code we can make all the CSS adjustments necessary. This means if you wished you could very easily make a little Javascript button that switches the stylesheet. The way it&#8217;s going to work is for any class which needs to change we just add an extra style beginning with body#dark. So first of all we say:</p>
<pre name="code" class="html">
body#dark {
	background-color:#1e1d1b;
}
body#dark #main {
	background:#292826 url(images/background_dark_slice.jpg) repeat-x;
}
body#dark #main .container {
	background-image:url(images/background_dark.jpg);
}
body#dark #footer {
	background-image:url(images/background_dark_footer.jpg);
}
body#dark ul#menu li a.active, ul#menu li a:hover {
	color:#ffffff;
}
</pre>
<p>And that tells the browser that if &lt;body id=&quot;dark&quot;&gt; then to override the styles for #main, #main .container, #footer, and the active and hover states of the menu, swapping in some new background images and changing the text colour to white! Easy as pie!</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/38.jpg" alt="" /></div>
<h3>Step 25 &#8211; Borders and Fixing the Text</h3>
<p>As you can see in the image below our footer is fixed thanks to the new background image and colour, there&#8217;s just two more fixes: the &quot;Creatif is a WordPress &#8230;&quot; text and the borders around the boxes which are quite light and should be dark now. So we do this:</p>
<pre name="code" class="css">
body#dark .block, body#dark .mini_portfolio_item {
	border-color:#1b1a19;
}
body#dark #text_column h2#text_title {
	background-image:url(images/creatif_dark.jpg);
}
</pre>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/37.jpg" /></div>
<h3>Step 26 &#8211; Alternate Colour!</h3>
<p>And that&#8217;s it! We have an alternate colour scheme all controlled by a single id tag on the &lt;body&gt; element. That&#8217;s the magic of transparent PNG files and CSS for ya!</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/017_Creatif/Images/39.jpg" alt="" /></div>
<h3>Finito!</h3>
<p>So that&#8217;s it! The HTML is totally finished. Don&#8217;t forget you can see the full pages by following these links:</p>
<ol>
<li><a href="http://nettuts.s3.amazonaws.com/017_Creatif/Site/index.html">Portfolio Home</a></li>
<li><a href="http://nettuts.s3.amazonaws.com/017_Creatif/Site/blog.html">Blog Home</a></li>
<li><a href="http://nettuts.s3.amazonaws.com/017_Creatif/Site/page.html">General Purpose Page</a></li>
<li><a href="http://nettuts.s3.amazonaws.com/017_Creatif/Site/index_alternate.html">Alternate Colour Scheme</a></li>
</ol>
<p>Additionally you can <a href="http://nettuts.s3.amazonaws.com/017_Creatif/Site_Download.zip">download the full HTML/CSS/Image source files here</a> and via PSDTUTS Plus you can get the <a href="http://psdtuts.com/news/new-plus-tutorial-designing-a-family-of-websites/">full layered PSD files *and* a tutorial on designing them up</a>.</p>
<p>Finally if you are interested in my upcoming ebook on WordPress theming &#8211; <strong>How to Be a Rockstar WordPress Designer </strong>- where I&#8217;ll show you how to build these themes and lots of other neat stuff, then you can add your name to the mailing list below and we&#8217;ll send you a $10 off discount code when it comes out:</p>
<form action="http://flashden.cmail1.com/s/242357/" method="post">
<div>
<p><input type="text" name="name" id="name" value="Your Name" />
				    </p>
<input type="text" name="cm-242357-242357" id="l242357-242357" value="Your Email"/>
				    </p>
<input type="submit" value="Subscribe"  class="button"/>
<p><em>(Note that the discount code email is the only one you&#8217;ll get, your details won&#8217;t be going anywhere else!)</em></p>
</p></div>
</p></form>
]]></content:encoded>
			<wfw:commentRss>http://net.tutsplus.com/tutorials/site-builds/from-psd-to-html-building-a-set-of-website-designs-step-by-step/feed/</wfw:commentRss>
		<slash:comments>361</slash:comments>
		</item>
		<item>
		<title>How to Build a Maintainable Site using CushyCMS and Twitter</title>
		<link>http://net.tutsplus.com/tutorials/site-builds/how-to-build-a-maintainable-site-using-cushycms-and-twitter/</link>
		<comments>http://net.tutsplus.com/tutorials/site-builds/how-to-build-a-maintainable-site-using-cushycms-and-twitter/#comments</comments>
		<pubDate>Wed, 14 May 2008 06:27:49 +0000</pubDate>
		<dc:creator>Collis Ta'eed</dc:creator>
				<category><![CDATA[Site Builds]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[CushyCMS]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://nettuts.com/?p=22</guid>
		<description><![CDATA[<img src="http://nettuts.s3.amazonaws.com/005_Cushy/200.jpg">]]></description>
			<content:encoded><![CDATA[<p>Sometimes it seems there are as many CMS products out there as there are web developers. In this tutorial we&#8217;re going to build a simple one-page site and then in less than 5 minutes, get it setup with a Twitter feed for daily updates and with <a href="http://cushycms.com">CushyCMS</a> for general content.  If you haven&#8217;t seen it, Cushy is a completely free and <em>extremely</em> simple to use product that&#8217;s come on the market recently.<span id="more-22"></span></p>
<h3>Demo and Source Code</h3>
<div class="tutorial_image">
<a href="http://nettuts.s3.amazonaws.com/005_Cushy/Site/Site.zip"><img src="http://nettuts.com/wp-content/themes/nettuts/site_images/button_src_nm.jpg"></a><br />
<a href="http://collistaeed.com/"><img src="http://nettuts.com/wp-content/themes/nettuts/site_images/button_demo_nm.jpg"></a>
</div>
<h3>The Brief!</h3>
<p>Recently I came to the realisation that I should really have a personal site. I don&#8217;t take design work, but it&#8217;s nice to have a place to refer to when I write bio&#8217;s and so on.  Also a month or so ago I started using Twitter to put up my daily thoughts on business, the web and stuff.  This seemed like a logical thing to stick on my personal page. Also it&#8217;s important that the site be easy to manage so I don&#8217;t let it get outta date.  So you could say this was my brief.</p>
<h3>First a Design</h3>
<p>Before getting to the build I spent a few hours in Photoshop trying some ideas. I need something simple &#8211; I don&#8217;t have time for anything else, professional &#8211; who knows who is going to visit, and nice looking &#8211; I do claim to be a designer right? </p>
<p>Anyhow here is my design. I used a nice vector illustration from <a href="http://www.istockphoto.com/file_closeup.php?id=4645487">iStock</a> &#8211; always good for doing something quick that looks awesome! I used a really nice and free font &#8211; <a href="http://www.seite4.com/609.0.html">Colaborate Thin</a>. And finally a nice orange-blue colour scheme that by a stroke of good fortune turned out to match my orange photo!</p>
<p>So I won&#8217;t dwell on the design too much. If you click the image below you can get a large version of the JPG in case you want to follow along. </p>
<div class="tutorial_image"><a href="1_large.jpg"><img src="http://nettuts.s3.amazonaws.com/005_Cushy/1.jpg" /></a></div>
<h3>Step 1 &#8211; Cutting up Images</h3>
<p>Looking at the design in Photoshop, it&#8217;s clear there are a bunch of images I&#8217;m going to need. If this were a more complex design, I&#8217;d use Photoshop&#8217;s Slice tool, but it&#8217;s pretty simple, so I&#8217;ll just crop the file and create a bunch of images &#8211; one for the table, one for all the titles, one for the &quot;follow me&quot; bubble, one for the nettuts image and one for the photo of my giant forehead! Here are the images I made:</p>
<div class="tutorial_image">
<img src="http://nettuts.s3.amazonaws.com/005_Cushy/Site/images/Computer.jpg" /><br />
<img src="http://nettuts.s3.amazonaws.com/005_Cushy/Site/images/photo_sm.jpg" /><br />
<img src="http://nettuts.s3.amazonaws.com/005_Cushy/Site/images/project_nettuts.jpg" /><br />
<img src="http://nettuts.s3.amazonaws.com/005_Cushy/Site/images/title_about_nm.jpg" /><br />
<img src="http://nettuts.s3.amazonaws.com/005_Cushy/Site/images/twitter_nm.jpg" /></div>
<p>Note I&#8217;ve only shown one title, but of course I actually made lots of those.</p>
<h3>Step 2 &#8211; Planning the HTML</h3>
<p>Next we plan our HTML layout. Very deliberately this site is going to be extremely easy to build. It&#8217;s simply a sequence of blocks. Previously I&#8217;ve written about how to us <a href="http://nettuts.com/site-builds/build-a-sleek-portfolio-site-from-scratch/">Absolute Positioning</a> to make a layout, this time we&#8217;re going to use super simple <strong>Relative Positioning</strong>.</p>
<p>As you will recall when you place elements on a page they have a natural place they go to, relative to elements that came before. Because we&#8217;re not using columns or really anything fancy in this design it&#8217;s going to be perfect for using this regular postioning. </p>
<p>As a general rule, whenever you want to make your life easy in HTML, it&#8217;s best to do things in blocks laid out horizontally. This is the easiest way to work with CSS and doesn&#8217;t require much fiddling for browser compatibility. As soon as you start putting in columned layouts, things get a bit trickier. So we&#8217;ll save that for another tutorial, on another project.</p>
<p>So anyhow the layout we&#8217;ll use is something like this:</p>
<pre>
Main Heading

Section Heading
Div Block of Content

Section Heading
Div Block of Content

Section Heading
Div Block of Content

... and so on...
</pre>
<p>The best thing about this plan is that later on if we suddenly go &quot;hey I wish I had my an extra block for favourite images&quot;, it&#8217;s like no problemo! Just slip it in, use the same CSS classes and everything.  This really is the simplest layout around, and with a nice design it can look really cool nonetheless!</p>
<h3>Step 3 &#8211; Laying out the initial HTML</h3>
<p>OK Create an index.html file and then here&#8217;s my first stab at the HTML, it&#8217;s not perfect and is missing the Twitter bit, but it&#8217;s a good starting point and we can make a few adjustments later as we go:</p>
<pre name="code" class="html">
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
&lt;head>
	&lt;title>Collis Ta'eed - A Little About Me&lt;/title>
	&lt;link rel="stylesheet" href="style.css" type="text/css" media="screen" />
&lt;/head>

&lt;body>
&lt;div id="container">

    &lt;h1>&lt;span>Hi I'm Collis, entrepreneur, blogger and designer.&lt;/span>&lt;/h1>

	&lt;img src="images/title_about_nm.jpg" alt="About Me" />
    &lt;div id="about" class="content_box">

    	&lt;a href="">&lt;img src="images/photo_sm.jpg" class="photo" alt="Collis" />&lt;/a>
	    &lt;p>After working as a web designer - both employed and freelance - I cofounded a startup with a few friends in 2006.  Our company, &lt;a href="http://eden.cc">Eden&lt;/a>, has since grown and I've had the good fortune to work on lots of very exciting and interesting projects, everything from &lt;a href="http://flashden.net">FlashDen&lt;/a> to &lt;a href="http://blogactionday.org">Blog Action Day&lt;/a>. &lt;/p>

		&lt;p>Thanks to the brilliant nature of the web, I'm currently living and working out of Hong Kong and travelling the world. You can find me online on &lt;a href="http://twitter.com/collis">Twitter&lt;/a> where I post random thoughts, or you can send me an email from the form at the bottom of this page.  Thanks for stopping by!&lt;/p>

    &lt;/div>

    &lt;img src="images/title_thoughts_nm.jpg" alt="Thoughts via Twitter" />
    &lt;div id="thoughts" class="content_box">
    &lt;/div>

    &lt;img src="images/title_project_nm.jpg" alt="Latest Projects" />
    &lt;div id="project" class="content_box">

    	&lt;a href="http://nettuts.com">&lt;img src="images/project_nettuts.jpg" />&lt;/a>
        &lt;a href="http://nettuts.com">NETTUTS&lt;/a>
		&lt;p>In April Eden launched a sister site to PSDTUTS which Iíve been working on.  The site hosts web development and design tutorials.&lt;/p>

    &lt;/div>

    &lt;img src="images/title_links_nm.jpg" alt="Links" />
    &lt;div id="links" class="content_box">

    	&lt;p>Some links to sites that I have a hand in:&lt;/p>

        &lt;ul>
        	&lt;li>&lt;a href="http://flashden.net">FlashDen&lt;/a> - Our main Eden project&lt;/li>
        	&lt;li>&lt;a href="http://freelanceswitch.com/book">How to Be a Rockstar Freelancer&lt;/a> - A book I cowrote with my lovely wife&lt;/li>
        	&lt;li>&lt;a href="http://freelanceswitch.com">FreelanceSwitch&lt;/a> - The highly successful blog on freelancing&lt;/li>
        	&lt;li>&lt;a href="http://psdtuts.com">PSDTUTS&lt;/a> - The best photoshop blog around!&lt;/li>
        	&lt;li>&lt;a href="http://blogactionday.org">Blog Action Day&lt;/a> - A nonprofit, annual event&lt;/li>
        &lt;/ul>  

    &lt;/div>

    &lt;img src="images/title_contact_nm.jpg" alt="Contact"/>
    &lt;div id="contact" class="content_box">

    &lt;p>I'm the first to admit that Iím not very good at answering all my emails, but I do my best and if you have need, then you can &lt;a href="mailto:whoiscollis@gmail.com">email me&lt;/a>.&lt;/p>

    &lt;/div>

&lt;/div>
&lt;/body>
&lt;/html></pre>
<p>Things to note:</p>
<ul>
<li>I&#8217;ve linked to a file called &quot;style.css&quot;. This is where we&#8217;ll place our styles later, so go ahead and create a file with that name.</li>
<li>The whole thing is inside a &lt;div id=&quot;container&quot;&gt;. I did this partly out of habit to be honest, but I&#8217;m going to use the &lt;div&gt; to place my background image. and to make sure I don&#8217;t stray out of the 1000px width that I need to stay inside of for people on 1024px x 768px screens.</li>
<li>The &quot;logo&quot; heading is inside a &lt;h1&gt;&lt;span&gt;&lt;/span&gt;&lt;/h1&gt;. Then we&#8217;ll use the &lt;span&gt; part to make the text invisible and give it a background image so it looks like the design. This has benefits for SEO, and was a suggestion from the comments of a previous NETTUTS tutorial (thank you commenter whose name I&#8217;ve forgotten, but whose suggestion I&#8217;ve taken to using! )</li>
<li>Each section is an &lt;img&gt; title and then a &lt;div class=&quot;content_box&quot;&gt;. I&#8217;ve filled them in mostly with content, except for the Twitter box which we&#8217;ll worry about in the next step.</li>
</ul>
<h3>Step 4 &#8211; Add a little CSS</h3>
<p>Now we&#8217;ll add a tiny bit of CSS to make the page look a bit more like where it&#8217;s going to end up. Create your &#8217;style.css&#8217; file and place these two definitions in:</p>
<pre name="code" class="css">
body {
	background-color:#191e25;
	margin:0; padding:0;
	color:#5f6874;
	font-family:"Lucida Grande", "Lucida Sans Unicode", Arial, Sans-serif;
	font-size:13px;
	line-height:21px;
}

#container {
	width:900px;
	padding:50px;
	padding-top:30px;
	background-image:url(images/Computer.jpg);
	background-repeat:no-repeat;
	background-position:top right;
}
</pre>
<p>A couple things to note:</p>
<ul>
<li>I&#8217;ve set a font-family that uses a slightly unusual set of fonts. Lucida Grande is on most, if not all Macs, and Lucida Sans Unicode is on most PC&#8217;s, so most people should see a nice Lucida typeface. If not they&#8217;ll still see Arial or some default sans-serif. Either ways Lucida looks cool, and that&#8217;s what I get to see <img src='http://net.tutsplus.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
<li>I&#8217;ve used my &lt;div id=&quot;container&quot; to place that computer image in the background, located at the top and right, and set the width of my content area to be 900px + 50px left padding + 50px right padding = 1000px. </li>
<li>The 50px padding we&#8217;ve set in the container will effectively do most of our positioning for us on the page.</li>
</ul>
<p>And here&#8217;s how our page is looking now:</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/005_Cushy/2.jpg" /></div>
<h3>Step 5 &#8211; Now Let&#8217;s Grab the Twitter</h3>
<p>Now we add the content from Twitter. This is a great way of making the page feel really dynamic because I update <a href="http://twitter.com/collis">my Twitter feed</a> most days. Also it&#8217;ll be a way of driving people over to add me to their Twitter networks, and then in the future when I launch new sites I can drive traffic to new places. So really it&#8217;s all part of my not-particularly-devious plan.</p>
<p>So Twitter have made grabbing their feed really easy for us, just do the following:</p>
<ol>
<li>Log in to your Twitter account</li>
<li>Click that Yellow box in the right hand bar that says <strong>&quot;Put your updates on your site!&quot;</strong></li>
<li>When prompted for MySpace, Blogger, etc, choose <strong>&quot;Other&quot;</strong></li>
<li>Select the <strong>HTML/JS</strong> option so we can style it up with CSS later</li>
<li>Then set the <strong>Number of Updates</strong> (I set mine to 3) and copy + paste the code.</li>
</ol>
<p>Here&#8217;s the process in images!</p>
<div class="tutorial_image">
    <img src="http://nettuts.s3.amazonaws.com/005_Cushy/3.jpg" /><br />
    <img src="http://nettuts.s3.amazonaws.com/005_Cushy/4.jpg" /><br />
    <img src="http://nettuts.s3.amazonaws.com/005_Cushy/5.jpg" /><br />
    <img src="http://nettuts.s3.amazonaws.com/005_Cushy/6.jpg" />
</div>
<p>And here&#8217;s the code that Twitter gives us: </p>
<pre name="code" class="html">
&lt;div id="twitter_div">

&lt;ul id="twitter_update_list">&lt;/ul>&lt;/div>
&lt;script type="text/javascript" src="http://twitter.com/javascripts/blogger.js">&lt;/script>
&lt;script type="text/javascript" src="http://twitter.com/statuses/user_timeline/collis.json?callback=twitterCallback2&#038;count=3">&lt;/script>
</pre>
<p>Note I deleted the &lt;h2&gt; bit that Twitter inserts in, because we don&#8217;t need an extra title, we&#8217;ve already got one. Then it&#8217;s also worth taking Twitter&#8217;s advice and moving the two Javascript lines to the bottom of the page just before &lt;/body&gt;. That way it loads in last. Because Twitter is notorious for its downtime, this will stop them from killing our site accidentally!</p>
<p>So by looking at the HTML they&#8217;ve given us, we can guess that the Javascript is probably going to fill in that &lt;ul&gt; with our tweets inside the &lt;li&gt;&#8217;s it&#8217;ll place there. And that is exactly what it does do&#8230;</p>
<h3>Step 6 &#8211; Add Google Analytics</h3>
<p>Now at this point I will also add in some Javascript to hook my site up with <a href="http://google.com/analytics">Google Analytics</a>. I think most web developers have heard of Analytics, but if by chance you&#8217;ve been living under a rock, I really recommend trying it out. It&#8217;s free, and it&#8217;s a powerful way to monitor your traffic. When you&#8217;ve gotten an account, you simple <strong>Create a New Website Profile</strong>, enter a domain name and you&#8217;ll get in exchange some Javascript code to paste into your HTML documents. Easy peasy!</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/005_Cushy/7.jpg" /></div>
<h3>Step 7 &#8211; More CSS</h3>
<p>Next we&#8217;ll add a couple more styles that will get us even closer to our end product. They are:</p>
<pre name="code" class="css">
a img { border:0 }

a { color:#cc5630; text-decoration:none; }
a:hover { color:#ffffff; }

.content_box {
	width:590px;
	margin-top:15px;
	margin-bottom:30px;
}
</pre>
<p>Here we are removing borders of linked images (i.e. the link to NETTUTS and the photo of me which will link to a bigger version), also we&#8217;re setting the colour of our links on the page in general. Finally with the content_box style we set a width for our content blobs and using top and bottom margins separate them up on the page. Here&#8217;s how our page looks now:</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/005_Cushy/8.jpg" /></div>
<p>The next thing to do is to get some text-wrapping happening around our two images. The first thing to do is add an class to the images we want to wrap (the photo and the nettuts image). I didn&#8217;t think to do this earlier, but can see I need to now. So we change the images to have:</p>
<pre name="code" class="html">
&lt;img src="images/photo_sm.jpg" class="photo" alt="Collis"/>
</pre>
<p>Then we add a quick style to make the float to the left with a bit of a margin, like this:</p>
<pre name="code" class="css">
img.photo {
	float:left; margin-right:20px;
}
</pre>
<p>Unfortunately while nice and simple, this solution doesn&#8217;t quite make the grade because my text block is too long, so it&#8217;s wrapping &#8230; booo! Never mind, easily fixed. We&#8217;ll place that text in it&#8217;s own block and make it float too.</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/005_Cushy/9.jpg" /></div>
<p>So we&#8217;ll adjust this content_box so the HTML code is now:</p>
<pre name="code" class="html">

	&lt;div id="about" class="content_box">

    	&lt;a href="/images/collis.tif">&lt;img src="images/photo_sm.jpg" class="photo" alt="Collis"/>&lt;/a>
	    &lt;div class="about_text">
            &lt;p>After working as a web designer - both employed and freelance - I cofounded a startup with a few friends in 2006.  Our company, &lt;a href="http://eden.cc">Eden&lt;/a>, has since grown and I've had the good fortune to work on lots of very exciting and interesting projects, everything from &lt;a href="http://flashden.net">FlashDen&lt;/a> to &lt;a href="http://blogactionday.org">Blog Action Day&lt;/a>. &lt;/p>

            &lt;p>Thanks to the brilliant nature of the web, I'm currently living and working out of Hong Kong and travelling the world. You can find me online on &lt;a href="http://twitter.com/collis">Twitter&lt;/a> where I post random thoughts, or you can send me an email from the form at the bottom of this page.  Thanks for stopping by!&lt;/p>
		&lt;/div>  

        &lt;div class="clear">&lt;/div>

    &lt;/div>
</pre>
<p>So you can see I&#8217;ve wrapped the text in a &lt;div class=&quot;about_text&quot;&gt;&lt;/div&gt; and then added a &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt; at the bottom. This extra &lt;div&gt; will be used to clear the floats, otherwise the floating layers would wind up going over the top of the content further down the page. So here is the additional CSS code to make this work:</p>
<pre name="code" class="css">
.about_text {
	float:left; width:380px;

}
.clear { clear:both;}
</pre>
<p>We have to give our about_text block a width so it floats alongside the photo. Now that fixes our problem nicely. However if you look at the image shown below, it seems like there is a weird gap that&#8217;s appearing between the top of our text block and the image. </p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/005_Cushy/11.jpg" /></div>
<p>Weird gaps are the <em>worst</em> to come across, because it can be really hard to figure out what&#8217;s causing them. In our case here though I happen to remember that the &lt;p&gt; tag has a default top margin which if we get rid of will probably solve our issue.  Here&#8217;s the code to fix this: </p>
<pre name="code" class="css">
	p { margin:0px; margin-bottom:20px; }
</pre>
<p>So now every paragraph will have no margin except 20px below it (spacing out the next paragraph element).</p>
<h3>Step 8 &#8211; Replace our Heading</h3>
<p>As I mentioned earlier we&#8217;re going to use a bit of CSS to replace our &lt;h1&gt; tag at the top with the much nicer looking image so we get SEO benefits<em> and</em> nice looking title. If I was conscientious I would do this technique with all those subheadings too &#8230; but I&#8217;m not! </p>
<p>So all we&#8217;re going to do is use the &lt;span&gt; tag that we so cleverly placed earlier to set the text&#8217;s display to none &#8211; making it hidden. Then we&#8217;ll give the &lt;h1&gt; a height so the background image doesn&#8217;t get cut off, and finally we&#8217;ll set the image to appear. Here&#8217;s the CSS code we need to make this happen:</p>
<pre name="code" class="css">
h1 {
	background-image:url(images/title_main.jpg);
	background-repeat:no-repeat;
	height:60px;
	margin-bottom:50px;
}
h1 span {
	display:none;
}
</pre>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/005_Cushy/12.jpg" /></div>
<h3>Step 9 &#8211; Style the Twitter Area</h3>
<p>Next we&#8217;ll style our twitter box. But before we do, I realised I&#8217;d totally forgotten to place my &quot;Follow Me on Twitter&quot; image on the page (silly Collis!) No matter, I&#8217;ll add it in now, here&#8217;s the resulting HTML code for the area we are working on:</p>
<pre name="code" class="html">
	&lt;img src="images/title_thoughts_nm.jpg" alt="Thoughts via Twitter"/>
    &lt;div id="thoughts" class="content_box">

    	&lt;div id="twitter_div">
            &lt;ul id="twitter_update_list">&lt;/ul>
            &lt;a href="http://twitter.com/collis">&lt;img src="images/twitter_nm.jpg" alt="Follow Me on Twitter" />&lt;/a>
        &lt;/div>

    &lt;/div>
</pre>
<p>Notice that the image appears <em>inside</em> the twitter_div. We&#8217;re going to use one of the great benefits of CSS styling to position it so it sits outside of the box. Now if this were the old days and I was making this layout with a &lt;table&gt;, I would wind up using SOO much more code here, setting borders and lots of background images and stuff. Thank goodness for CSS. Here&#8217;s our CSS code:</p>
<pre name="code" class="css">
#twitter_div {
	border:1px solid #222830;
	background-color:#101318;
	position:relative;
	min-height:40px;
	padding:40px;
}
#twitter_div img {
	position:absolute;
	bottom:-22px;
	right:-14px;
}
</pre>
<p>This code turns our twitter_div box into a nice dark box and then positions the &lt;img&gt; inside. Notice that I&#8217;ve given the outer twitter_div a <em>relative</em> position. Then on the inside I&#8217;ve set the image to an <em>absolute</em> position. Absolute positioning always positions according to the last container with a relative position. If isn&#8217;t contained inside any other HTML elements, or none of those elements have a relative position, then it defaults back to the whole browser window. </p>
<p>Because our twitter_div is relatively positioned though, the absolute position will be in relation to that &lt;div&gt;. So in other words top:0px, left:0px, would be the top-left of the twitter_div container. Similarly, bottom:-22px and right:-14px, is measured from the bottom-right of the twitter_div. In this case because we&#8217;ve added minus numbers, we&#8217;re actually positioning it <em>outside</em> the div.</p>
<p>This is the easiest way to place images that are meant to overlap a box, border, line, whatever. </p>
<p>Positioning can be a bit fiddly to find the exact right number of pixels but you can work it out quickly with a sophisticated technique I call &quot;trial and error&quot; <img src='http://net.tutsplus.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/005_Cushy/13.jpg" /></div>
<h3>Step 10 &#8211; Style the Twitter FEED</h3>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/005_Cushy/14.jpg" /></div>
<p>So that&#8217;s looking pretty good now, but really not quite what we had in mind. In fact what I originally wanted was the date/time to be on the left hand side, where the bullet points are. And of course the whole thing needs better spacing.</p>
<p>Now because the content is coming from some Javascript which we don&#8217;t have any control over, what we need to do is figure out a way to work with what we have.  Here&#8217;s what we know:</p>
<ul>
<li>Each tweet is in an &lt;li&gt;&lt;/li&gt; element.</li>
<li>The date/time bit is a link, so it must be wrapped in an &lt;a&gt;&lt;/a&gt; element.</li>
<li>And we know that the link is the <em>last</em> thing in each tweet.</li>
<li>And we know that links inside of tweets aren&#8217;t linked. (I know this because I tried pushing through an actual link and it didn&#8217;t appear linked). SO in other words we know that the date/time bit is the <em>ONLY</em> element wrapped in an &lt;a&gt;&lt;/a&gt;.</li>
</ul>
<p>So using this information we can apply a style to the &lt;li&gt; and &lt;a&gt; elements to format it how we want. Here&#8217;s how we do it:</p>
<pre name="code" class="css">
#twitter_div ul {
	margin:0px;
	padding:0px;
}
#twitter_div ul li {
	list-style:none;
	margin-bottom:5px;
	margin-left:90px;
	font-size:12px;
}
#twitter_div ul li a {
	width:70px;
	display:block;
	position:relative;
	top:-43px;
	left:-90px;
	line-height:19px;
	text-transform:capitalize;
}
</pre>
<p>Some things to notice about the first two definitions:</p>
<ol>
<li>The first definition just gets rid of default margins and padding on the &lt;ul&gt; element</li>
<li>Next we get rid of the bullet points (list-style:none). Then we separate the &lt;li&gt; elements with a bottom margin</li>
<li>Then we also tell the &lt;li&gt; elements to have a huge left margin of 90px. This will make enough space for us to move our date/time links into the gap.</li>
</ol>
<p>The last definition applies to any &lt;a&gt; elements in the list, which is why it was important to check that these date/time links were the only links. First we tell the link to display:block. By setting the link to be a block level element, we stop it from sitting inline with the rest of the text and move it by default to sit below the text as a block. </p>
<p>Now because by default a block element like our link now is, will align to the left, we can say with confidence where the link will be positioned. I.e. that it will be just below our text and aligned to the left. If you want to see what I mean, just delete everything after display:block and look at the result.</p>
<p>With this knowledge, we can use relative positioning to move it <em>relative</em> to where it is now. So we say the link should be 43px higher than where it currently is, and 90px to the left. And this then places the link right where we wanted it! Try it and see!</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/005_Cushy/16.jpg" /></div>
<h3>Complete HTML &#038; CSS</h3>
<p>OK! We&#8217;re done with our HTML and CSS! You can download the files &#8211; images, CSS, HTML &#8211; using the link below:</p>
<p><big><a href="http://nettuts.s3.amazonaws.com/005_Cushy/Site/Site.zip">Download Images/HTML/CSS</a></big></p>
<h3>Step 11 &#8211; Testing for Screensize</h3>
<p>Now we&#8217;re done with our HTML it&#8217;s time to do some testing. The first thing to test is how it&#8217;s going to look on a 1024&#215;768 screen. I use a Firefox plugin to do this called <a href="https://addons.mozilla.org/en-US/firefox/addon/5792">Firesizer</a> which is just so handy. It appears in the status bar, as shown and you select the screensize and Bam!</p>
<p>Anyhow everything turned out OK so no changes here!</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/005_Cushy/17.jpg" /></div>
<h3>Step 12 &#8211; Testing for IE6</h3>
<p>Next we test IE6. Because I&#8217;m on a Mac, I use a really crappy IE6 solution using something called <a href="http://darwine.sourceforge.net/">Darwine</a>. On a PC you can get a standalone install of IE6 that doesn&#8217;t tamper with your IE7 install.</p>
<p>If you&#8217;re a web developer and you use IE6 by default, you need to stop immediately! hehe. Well I guess there would be cases where it&#8217;d be a good idea &#8211; e.g. if you were developing for a huge IE6 audience. Still, that&#8217;d be pretty weird. I highly recommend Firefox myself, but Opera, Safari, IE8 Beta, even IE7 would be good. Not to mention all the more obscure browsers&#8230;</p>
<p><em>(Note there is an IE7 solution via Darwine too, but as far as I can tell it&#8217;s demented &#8230; like really crazy and unusable)</em></p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/005_Cushy/18.jpg" /></div>
<h3>Step 13 &#8211; Testing for IE7</h3>
<p>Now we test for IE7 because although it&#8217;s much better than IE6, it can still do the crazies now and again. For this I have to run my newly installed copy of Parallels.</p>
<p>Boy browser testing is laborious! </p>
<p>Still it&#8217;s not nearly as labourious as if I&#8217;d run into problems! Fortunately it all checked out OK.</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/005_Cushy/20.jpg" /></div>
<h3>Step 14 &#8211; Validate Our Markup</h3>
<p>And finally because some commenters here are NETTUTS suggested that I really should be validating my markup, we&#8217;ll go push it through the <a href="http://validator.w3.org">W3C validator</a></p>
<p>Now I know it <em>looks</em> like I have lots of problems there, but in fact they are all coming from the Twitter Javascript &#8211; tsk, tsk, tsk, for shame! hehe. So it&#8217;s OK, I&#8217;m off the hook!</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/005_Cushy/19.jpg" /></div>
<h3>Step 15 &#8211; The HTML is Finished! Now to Upload &#8230;</h3>
<p>And now it&#8217;s time to upload. I get out my trusty <a href="http://filezilla-project.org/">FileZilla</a> and hook up to <a href="http://collistaeed.com">collistaeed.com</a> and up goes the site!</p>
<p>With that done &#8230; we can turn to CushyCMS!</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/005_Cushy/upload.jpg" /></div>
<h3>Step 16 &#8211; CushyCMS &#8211; Introduction</h3>
<p>Now the purpose of this tutorial was really to show you how to use CushyCMS. At least it was until I realised that this is kinda stupidly easy to use and not really worth a tutorial (I learnt to use it from that video they have on their site!)</p>
<p>So anyhow the service is completely free and works by FTPing into your server and modifying the files you tell it to modify. It&#8217;s really simple to use as you&#8217;ll see, not hugely featured, but it does what it does well. From their homepage it looks like there will be more stuff coming in the future which they&#8217;ll be charging for.</p>
<p>I recommend giving it a try as it could be a nice solution for a lot of small client websites, or of course for a site like mine! So anyway, we go to <a href="http://cushycms.com">CushyCMS and sign up</a>.</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/005_Cushy/21.jpg" /></div>
<h3>Step 17 &#8211; Setup CushyCMS For The New Site</h3>
<p>Once you&#8217;re logged in, it&#8217;s a two step process to get setup:</p>
<ol>
<li>The first thing to do is <strong>Add a Site</strong>. This basically just involves giving them the FTP details</li>
<li>Then we <strong>Assign Page(s)</strong>, for us there&#8217;s only one, so that&#8217;s an easy choice</li>
</ol>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/005_Cushy/22.jpg" /></div>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/005_Cushy/23.jpg" /></div>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/005_Cushy/24.jpg" /></div>
<h3>Step 18 &#8211; Adding the CushyCMS Class</h3>
<p>Now in order for CushyCMS to know what elements should be editable, we need to specify them in the HTML of the page using a special class definition. So we have to go back to our HTML and  add in some <strong>class=&quot;cushycms&quot;</strong> bits. </p>
<p>Now the bits we want to be editable are those &lt;div class=&quot;content_box&quot;&gt; areas. But they already have a class= definition. But that&#8217;s OK! You can assign multiple classes to a single element by separating them with a space like this: &lt;div class=&quot;content_box cushycms&quot;&gt;. So the resulting HTML code is:</p>
<pre name="code" class="html">
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
&lt;head>
	&lt;title>Collis Ta'eed - A Little About Me&lt;/title>
	&lt;link rel="stylesheet" href="style.css" type="text/css" media="screen" />
&lt;/head>

&lt;body>
&lt;div id="container">

    &lt;h1>&lt;span>Hi I'm Collis, entrepreneur, blogger and designer.&lt;/span>&lt;/h1>

	&lt;img src="images/title_about_nm.jpg" alt="About Me" />
    &lt;div id="about" class="content_box cushycms">

    	&lt;a href="/images/collis.tif">&lt;img src="images/photo_sm.jpg" class="photo" alt="Collis"/>&lt;/a>
	    &lt;div class="about_text">
            &lt;p>After working as a web designer - both employed and freelance - I cofounded a startup with a few friends in 2006.  Our company, &lt;a href="http://eden.cc">Eden&lt;/a>, has since grown and I've had the good fortune to work on lots of very exciting and interesting projects, everything from &lt;a href="http://flashden.net">FlashDen&lt;/a> to &lt;a href="http://blogactionday.org">Blog Action Day&lt;/a>. &lt;/p>

            &lt;p>Thanks to the brilliant nature of the web, I'm currently living and working out of Hong Kong and travelling the world. You can find me online on &lt;a href="http://twitter.com/collis">Twitter&lt;/a> where I post random thoughts, or you can send me an email from the form at the bottom of this page.  Thanks for stopping by!&lt;/p>
		&lt;/div>  

        &lt;div class="clear">&lt;/div>

    &lt;/div>

    &lt;img src="images/title_thoughts_nm.jpg" alt="Thoughts via Twitter"/>
    &lt;div id="thoughts" class="content_box">

    	&lt;div id="twitter_div">
            &lt;ul id="twitter_update_list">&lt;/ul>
            &lt;a href="http://twitter.com/collis">&lt;img src="images/twitter_nm.jpg" alt="Follow Me on Twitter" />&lt;/a>
        &lt;/div>

    &lt;/div>

    &lt;img src="images/title_project_nm.jpg" alt="Latest Projects"/>
    &lt;div id="project" class="content_box cushycms">
    	&lt;br />
    	&lt;a href="http://nettuts.com">&lt;img src="images/project_nettuts.jpg" class="photo" alt="NETTUTS"/>&lt;/a>
        &lt;a href="http://nettuts.com">NETTUTS&lt;/a>
		&lt;p>In April Eden launched a sister site to PSDTUTS which I've been working on.  The site hosts web development and design tutorials.&lt;/p>
    	&lt;div class="clear">&lt;/div>
    &lt;/div>

    &lt;img src="images/title_links_nm.jpg" alt="Links" />
    &lt;div id="links" class="content_box cushycms">

    	&lt;p>Some links to sites that I have a hand in:&lt;/p>

        &lt;ul>
        	&lt;li>&lt;a href="http://flashden.net">FlashDen&lt;/a> - Our main Eden project&lt;/li>
        	&lt;li>&lt;a href="http://freelanceswitch.com/book">How to Be a Rockstar Freelancer&lt;/a> - A book I cowrote with my lovely wife&lt;/li>
        	&lt;li>&lt;a href="http://freelanceswitch.com">FreelanceSwitch&lt;/a> - The highly successful blog on freelancing&lt;/li>
        	&lt;li>&lt;a href="http://psdtuts.com">PSDTUTS&lt;/a> - The best photoshop blog around!&lt;/li>
        	&lt;li>&lt;a href="http://blogactionday.org">Blog Action Day&lt;/a> - A nonprofit, annual event&lt;/li>
        &lt;/ul>  

    &lt;/div>

    &lt;img src="images/title_contact_nm.jpg" style="clear:both" alt="Contact Me"/>
    &lt;div id="contact" class="content_box cushycms">

    &lt;p>I'm the first to admit that I'm not very good at answering all my emails, but I do my best and if you have need, then you can &lt;a href="mailto:whoiscollis@gmail.com">email me&lt;/a>.&lt;/p>

    &lt;/div>

&lt;/div>
&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
&lt;/script>
&lt;script type="text/javascript">
_uacct = "UA-249823-23";
urchinTracker();
&lt;/script>
&lt;script type="text/javascript" src="http://twitter.com/javascripts/blogger.js">&lt;/script>
&lt;script type="text/javascript" src="http://twitter.com/statuses/user_timeline/collis.json?callback=twitterCallback2&#038;count=3">&lt;/script>
&lt;/body>
&lt;/html></pre>
<p>Now we go back to CushyCMS and our page is fully editable!</p>
<p>One thing, I should point out is that when I tried to make my Twitter area editable, the CushyCMS system just deleted my empty &lt;ul&gt; element, thereby rendering the Twitter thing unworkable. Unfortunately it seems the editor is a bit too clever for its own good. Still apart from that small annoyance, the system was really not too bad at all. I tend to switch to the <strong>Source</strong> view when editing, but I can see that clients would find it pretty easy to use. I&#8217;m interested to see what things they add in the upcoming paid version.</p>
<p>As a good alternative to this sort of super easy, no coding required, sort of CMS, you could also check out <a href="http://speaklight.com">Light CMS</a> which I&#8217;ve tried and quite liked too &#8211; though it works a little differently.</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/005_Cushy/25.jpg" /></div>
<h3>Conclusion!</h3>
<p>So hope you enjoyed the tutorial. Be sure to visit <a href="http://collistaeed.com">my site</a>, and <a href="http://twitter.com/collis">twitter feed</a> and give the CMS a whirl.</p>
<p>If you know of any other similar CMS products (like Cushy or Light), please leave a comment as it&#8217;d be good to do a wrap up of them here sometime.</p>
]]></content:encoded>
			<wfw:commentRss>http://net.tutsplus.com/tutorials/site-builds/how-to-build-a-maintainable-site-using-cushycms-and-twitter/feed/</wfw:commentRss>
		<slash:comments>171</slash:comments>
		</item>
		<item>
		<title>Build a Sleek Portfolio Site from Scratch</title>
		<link>http://net.tutsplus.com/tutorials/site-builds/build-a-sleek-portfolio-site-from-scratch/</link>
		<comments>http://net.tutsplus.com/tutorials/site-builds/build-a-sleek-portfolio-site-from-scratch/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 05:11:46 +0000</pubDate>
		<dc:creator>Collis Ta'eed</dc:creator>
				<category><![CDATA[Site Builds]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://nettuts.com/?p=16</guid>
		<description><![CDATA[<img src="http://psdtuts.s3.amazonaws.com/115_WebDesign/200.jpg">]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s nothing like building an entire site to show you a good overview of how a CSS layout should work. Over at PSDTUTS we&#8217;ve got a <a href="http://psdtuts.com/interface-tutorials/create-a-sleek-high-end-web-design-from-scratch/">tutorial where you design up a sleek, high end web design</a>. In this tutorial we&#8217;re going to take that PSD file and build it with some nice clean HTML and CSS.</p>
<p>  <span id="more-16"></span></p>
<h3>Demo and Source Code</h3>
<div class="tutorial_image">
<a href="http://nettuts.s3.amazonaws.com/002_WebBuild/site/site.zip"><img src="http://nettuts.com/wp-content/themes/nettuts/site_images/button_src_nm.jpg"></a><br />
<a href="http://nettuts.s3.amazonaws.com/002_WebBuild/site/final.html"><img src="http://nettuts.com/wp-content/themes/nettuts/site_images/button_demo_nm.jpg"></a>
</div>
<h3>Step 1</h3>
<p>So here&#8217;s the design we&#8217;re going to be building.  As mentioned you can follow the tutorial over at <a href="http://psdtuts.com/interface-tutorials/create-a-sleek-high-end-web-design-from-scratch/">PSDTUTS to build this design from scratch</a>. In this tutorial we&#8217;re only going to build this homepage, however using that as a base you would be able to build interior pages following the same layout.</p>
<div class="tutorial_image"><a href="http://nettuts.s3.amazonaws.com/002_WebBuild/final_larg.jpg" target="_blank"><img src="http://nettuts.s3.amazonaws.com/002_WebBuild/final.jpg"  /></a></div>
<h3>Step 2</h3>
<p>The first thing to do is decide how we are going to structure our build. This process gets easier over time as you learn how CSS layouts can work. For this design I think we can get away with a very simple build which uses quite a bit of absolute positioning and a large background image.</p>
<p><strong>What is Absolute Positioning?</strong><br />
When you place an HTML element on a page (e.g. a &lt;div&gt;, &lt;p&gt; and so on) it has a natural position which is determined by what came before it. So for example if you put a &lt;p&gt;&lt;/p&gt; down with some text in it, and then you place another &lt;p&gt;&lt;/p&gt; it will naturally appear just below the first &lt;p&gt;. It will just flow on relative to the last element.</p>
<p>Absolute positioning is different in that you are specifying an exact placement for an object and taking it out of the regular flow of elements. So if you had your first &lt;p&gt;&lt;/p&gt; just as before, but for your next &lt;p&gt;&lt;/p&gt; you gave it an absolute position of left:500px; top:500px; Then it would appear precisely in that location regardless of the previous &lt;p&gt;.</p>
<p>You set the absolute position of something like this:</p>
<pre name="code" class="css">

.className {

	position:absolute;
    top:0px;
    left:0px;

}
</pre>
<p><strong>Drawbacks to Absolute Positioning</strong><br /> <br />
The main problem with using absolute positioning is that your elements don&#8217;t really relate to one another.  So for example if you have one block of text near the top of your page, and another block of text a bit further down, it might look great when each block of text is short.  But if the top block were to have a big essay in it, then instead of pushing the next block of text down, it will just go over the top.  This is because you are taking the elements out of the natural flow of the page.  </p>
<p>So Absolute Positioning is only really useful for objects that you know will always be a certain size, and which don&#8217;t really need to interact with other elements.</p>
<p><strong>Why it&#8217;s useful to us today<br />
</strong>The good thing about Absolute Positioning, is that it&#8217;s really, really easy! You tell the browser where to put something and that&#8217;s where it appears! To top it off, there are far fewer browser compatibility issues when you position things absolutely. After all 100px is 100px whether you&#8217;re in Firefox, Internet Explorer, or Safari.</p>
<p><strong>SOOO our layout<br />
</strong>So the way we are going to make our website is:</p>
<ul>
<li>Have a large background image</li>
<li>Absolutely position the logo, menus, and heading panel precisely where they are meant to appear</li>
<li>Have all our content appear in a regular &lt;div&gt; tag, but give it so much padding-top that the content is pushed all the way down to where it&#8217;s meant to be</li>
<li>Have our footer sitting underneath</li>
</ul>
<p>If that doesn&#8217;t make a whole lot of sense yet, don&#8217;t worry it will as you see the site take shape!</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/002_WebBuild/1.jpg"  /></div>
<h3>Step 3</h3>
<p>Now in terms of background images, we need two. One is going to be gigantic, and in fact after I saved it as a JPG it is about 56kb in size. There used to be a time where that would have been a bit too big, but these days it&#8217;s not a big deal. </p>
<p>So that&#8217;s the main area, then we need a second background image which will be a thin slice. This slice will repeat over and over off to the right so that when the browser window is dragged open it tiles out.</p>
<p>(Note the logo shouldn&#8217;t be showing below in the background image, that was just some bad screenshotting, sorry!)</p>
<p>You can see the two images I&#8217;ve created <a href="http://nettuts.s3.amazonaws.com/002_WebBuild/site/images/background_main.jpg">here</a> and <a href="http://nettuts.s3.amazonaws.com/002_WebBuild/site/images/background_slice.jpg">here</a>.</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/002_WebBuild/2.jpg"  /></div>
<h3>Step 4</h3>
<p>OK so now let&#8217;s start our HTML. First we lay out some basics:</p>
<pre name="code" class="html">

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
&lt;head>
	&lt;title>PSD vs NET&lt;/title>
	&lt;link rel="stylesheet" href="step1_style.css" type="text/css" media="screen" />
&lt;/head>

&lt;body>
&lt;div id="outside_container">
	&lt;div id="container">

		&lt;!-- The Main Area -->

	&lt;/div>
&lt;/div>
&lt;div id="footer">

	&lt;img src="images/footer_logo.jpg" />

    &lt;span id="footer_text">
        Made for a PSDTUTS and NETTUTS tutorial by Collis!
        See the &lt;a href="http://psdtuts.com">Photoshop Tutorial&lt;/a>,
        see the &lt;a href="http://nettuts.com">Web Tutorial&lt;/a>
    &lt;/span>

&lt;/div>
&lt;/body>
&lt;/html>
</pre>
<p>As always it&#8217;s best to work from the outside in with our layout. So what I&#8217;ve done here is place three major &lt;div&gt;&#8217;s. The first two are the <strong>outside_container</strong> / <strong>container</strong> and the other is the <strong>footer</strong>. This requires a little explaining:</p>
<ol>
<li>I&#8217;ve created the <strong>outside_container</strong> and <strong>container</strong> because I need a double background image. That is I need a tiling background image, and then on top of that I need that large background image. So in the <strong>outside_container</strong> I&#8217;ll place the tiling background, then on the <strong>container</strong> &lt;div&gt; which will appear on top of the outside container, I&#8217;ll have that big main background.</li>
<li>The footer needs to be outside the containers because if the browser window were stretched lengthwise, the footer should go on and on. Since it has its own background, it can&#8217;t be in the containers &#8211; if it were and you stretched at some point you&#8217;d see the container background and not the footer!</li>
</ol>
<p>Also you&#8217;ll see I&#8217;ve added some content inside the footer, that&#8217;s just the mini logo, and the text. I&#8217;ve wrapped the text in a &lt;span&gt; tag so that I can manipulate it. There&#8217;s no reason to give the &lt;img&gt; tag an id or a class, because we can just say #footer img and since it&#8217;s the only image in there, we can call it that way. This keeps our HTML a little simpler.</p>
<h3>Step 5</h3>
<p>Now the CSS for our code so far:</p>
<pre name="code" class="css">

body {
	margin:0px; padding:0px;
	background-color:#11090a;
	font-family:Arial, Helvetica, sans-serif;
}
#outside_container {
	background:url(images/background_slice.jpg) repeat-x #000000;
}
#container {
	background:url(images/background_main.jpg) no-repeat;
	min-height:800px;
}
#footer {
	border-top:1px solid #3f2324;
	padding:30px 50px 80px 50px;
}
</pre>
<p>So going through one at a time:</p>
<ol>
<li>First we are redefining the <strong>body</strong> tag. This is almost always the first thing I do. We get rid of any default margin and padding, set a background color and a font-family for the page. Notice that the background colour is in fact the <em>footer</em> background colour. As I mentioned previously this is so that if you stretch the browser window vertically you&#8217;ll keep seeing footer.</li>
<li>Next we have the <strong>outside_container</strong> tag. I&#8217;ve given it that slice background, it&#8217;s going to repeat only along the x axis (i.e. from left to right) and wherever there&#8217;s no background image we&#8217;ll see straight black (#000000). So basically as the page gets longer the tiles won&#8217;t keep going because we said to only repeat left-right, instead we&#8217;ll get the black background. This is perfect because our tiling image fades to black!</li>
<li>Next we have the <strong>container</strong>. Here we have the gigantic background image set to not repeat &#8211; so it only appears once. Notice we didn&#8217;t specify a background colour, if we had it would have covered our outside_container over. That&#8217;s because this &lt;div&gt; tag is inside the previous one, and will automatically be stretching out to fill it up completely. So our background image appears on top and then outside that area you can see the outside_container background showing through.</li>
<li>I&#8217;ve also given the container a minimum height, this is just so that when we look at the HTML page at this point you can see roughly how it&#8217;s going to look when there is content. Later on our content will produce the minimum height anyway.</li>
<li>The footer is basically just a single line border and some padding. There&#8217;s no need to give it a background colour, because we set that in the &lt;body&gt; earlier. Remember with the padding definitions it goes like this: <strong>padding: top right bottom left</strong> (clockwise!)</li>
</ol>
<p>Here&#8217;s where we are up to now&#8230; </p>
<h4><a href="http://nettuts.s3.amazonaws.com/002_WebBuild/site/step1.html">View The Site So Far</a> </h4>
<h3>Step 6</h3>
<p>Next we&#8217;ll finish off that footer by adding a few extra styles like this:</p>
<pre name="code" class="css">

/*
	Footer
*/
#footer {
	border-top:1px solid #3f2324;
	padding:30px 50px 80px 50px;
	color:#674f5d;
	font-size:9px;
	line-height:14px;
}
#footer img {
	float:left;
	margin-right:10px;
}
#footer span {
	display:block;
	float:left;
	width:250px;
}
#footer a {
	color:#9e8292;
	text-decoration:none;
}
#footer a:hover { color:#ffffff; }
</pre>
<p>So here I&#8217;ve added a few bits to our #footer class and created a few more classes. Let&#8217;s go through it one piece at a time:</p>
<ol>
<li>First of all the bits between /* and */ are CSS comments. It&#8217;s nice to have comments in your CSS file as it really breaks it up and helps keep things intelligible. Actually on larger projects I find CSS files can get pretty out of control if you&#8217;re not careful. So it&#8217;s really good to try to get into good habits early: <em>name your selectors well, add comments, keep like things together, break into multiple CSS files for larger projects and so on.</em></li>
<li>In <strong>#footer</strong> I&#8217;ve added a font color, font size and line-height to our previous definition. Line-height is a really useful text attribute as it helps you space out your text. Without good line-height text can look bunched up and harder to read. Too much line-height and the text will be so spaced out it looks weird. So you might want to experiment to find the right heights for different fonts and sizes. Here 14px seemed like a good fit.</li>
<li>Next I&#8217;ve set the <strong>#footer img</strong> and <strong>#footer span</strong> to both float:left. Because they are both set to float left, they end up in columns next to each other. I&#8217;ll talk more about floating and columns later in this tutorial. </li>
<li>Finally we tell the browser what to do with  &lt;a&gt; tags (i.e. links) that appear in the footer. Namely that they shouldn&#8217;t be underlined, and should change color when you hover over with a mouse. </li>
</ol>
<p>So with the addition of the footer here&#8217;s where up to: </p>
<h4><a href="http://nettuts.s3.amazonaws.com/002_WebBuild/site/step2.html">View The Site So Far</a></h4>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/002_WebBuild/3.jpg" /></div>
<h3>Step 7</h3>
<p>Now with the footer out of the way, let&#8217;s add some more content to the page inside the main container areas. First we need two new images that we make out of our PSD file:</p>
<div class="tutorial_image">
	<img src="http://nettuts.s3.amazonaws.com/002_WebBuild/site/images/logo.jpg" /><br />
    <img src="http://nettuts.s3.amazonaws.com/002_WebBuild/site/images/panel_home.jpg" /></div>
<p>Notice that I&#8217;ve used an image for the big text block. In general it&#8217;s best to use text for these things as it makes the page much more searchable and is good practice. But it would have been much harder to do as we&#8217;d need to use a bit of Flash and SIFr to achieve that effect. So since this is a fairly straightforward tutorial I&#8217;ve opted to just use a big image <img src='http://net.tutsplus.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Here&#8217;s a snippet of our HTML code &#8211; just the containers bit:</p>
<pre name="code" class="html">

&lt;div id="outside_container">
	&lt;div id="container">

		&lt;a href="#">&lt;img src="images/logo.jpg" id="logo" />&lt;/a>

        &lt;ul id="menu">
        	&lt;li>&lt;a href="#">Retouching&lt;/a>&lt;/li>
        	&lt;li>&lt;a href="#">Digital Effects&lt;/a>&lt;/li>
        	&lt;li>&lt;a href="#">Web Work&lt;/a>&lt;/li>
		&lt;/ul>

        &lt;ul id="right_menu">
        	&lt;li>&lt;a href="#">About&lt;/a>&lt;/li>
        	&lt;li>&lt;a href="#">Contact&lt;/a>&lt;/li>
        &lt;/ul>

        &lt;img src="images/panel_home.jpg" id="panel" />

		&lt;div id="content">

        	&lt;!-- THE CONTENT GOES IN HERE -->

        &lt;/div>

	&lt;/div>
&lt;/div>
</pre>
<p>So inside the container area we&#8217;ve added five things:</p>
<ol>
<li><strong>Our logo:</strong> It&#8217;s linked, so clicking it should take you to the homepage, and has id=&quot;logo&quot;</li>
<li><strong>Main menu:</strong> This is simply an unordered list with id=&quot;menu&quot;</li>
<li><strong>The right hand side menu: </strong>This is the same as the other menu, just different id=&quot;right_menu&quot;</li>
<li><strong>Big text panel image: </strong>This is our main heading text saved as an image, id=&quot;panel&quot;</li>
<li><strong>Content Div</strong>: And this is where we are going to place all our page content later on. I&#8217;ve left it empty right now except for an HTML comment.</li>
</ol>
<p>So before we start styling it up, it&#8217;s worth having a look to see how the page looks with just everything dumped on like this:</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/002_WebBuild/4.jpg" /></div>
<p>As you can see we&#8217;re going to have to do some serious shifting around to get everything into place. As you&#8217;ll recall we&#8217;re going to use Absolute Positioning to do this quickly and easily.</p>
<h3>Step 8</h3>
<p>Here&#8217;s the CSS we add to make our elements start to fit into place:</p>
<pre name="code" class="css">

#container {
	background:url(images/background_main.jpg) no-repeat;
	min-height:800px;
	width:1000px;
	position:relative;
}

/*
	Logo / Menu / Panel Positioning
*/

#logo { position:absolute; top:58px; left:51px; }

#panel { position:absolute; top:165px; left:51px; }

ul#menu {
	margin:0px;	padding:0px;
	position:absolute; top:145px; left:75px;
}
ul#right_menu {
	margin:0px;	padding:0px;
	position:absolute; top:145px; right:75px;
}
</pre>
<p>So again let&#8217;s go through each bit piece by piece:</p>
<ol>
<li>First of all, you&#8217;ll see an old bit of our code &#8211; the <strong>container</strong>. I&#8217;ve shown this as I&#8217;ve added two more lines to it now. It now has a <strong>width:1000px</strong> and <strong>position:relative</strong>. This is important because when you set position to be relative, anything absolutely positioned inside, is done so <em>relative</em> to that container tag. So this means I can position things inside this box, using the fact that I know it&#8217;s 1000px wide. Namely I&#8217;ll be using that for the right_menu.
  </li>
<li>Next because this is a new set of CSS, I&#8217;ve sectioned it off with a comment</li>
<li>With the <strong>logo</strong> and <strong>panel</strong> I&#8217;ve given both an absolute position on the page. How do I know what numbers to use? Simple go back to the original Photoshop document and measure out where they are meant to be! You can see it&#8217;s a really simple class definition, which is why absolute positioning is so easy.</li>
<li>Next with the two menus, these are also absolutely positioned, but here I&#8217;ve also given them <strong>margin:0px; padding:0px;</strong> definitions to make sure we clear away any default margins and padding which unordered lists have.</li>
<li>Next notice that on the <strong>right_menu</strong> when I have specified the absolute position to be <strong>right:75px</strong>. This means that it will appear 75px away from the right hand side of its container. Ordinarily that would be the browser window, but because remember earlier I set the <strong>container</strong> to have <strong>position:relative</strong> that means it will be 75px away form the right hand side of &lt;div id=&quot;container&quot;&gt;&lt;/div&gt;.
<p>  Now you might be thinking, well what&#8217;s the point, can&#8217;t I just position things using <strong>left</strong> only? Well you can, but with our menu, if you were to add extra menu items you would need to reposition it again and again so that it was still 75px away from the right hand side. Whereas by using <strong>right</strong> the extra menu items flow left when you add them. Try it and see!</li>
</ol>
<p>So here&#8217;s where we are at:</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/002_WebBuild/5.jpg" /></div>
<h3>Step 9</h3>
<p>As you can see in the previous image, the logo and heading element are now looking like they are in the right position. But the menus are looking kinda weird. Before we style those, a quick word on the logo / image panel. You might be wondering, if they are both images, why not make them part of the background image? </p>
<p>The answer is that the logo we want to make linkable, so that clicking it will take you back to the homepage (makes the site more usable), and the main text panel, well that would probably change from page to page. So by having it a single image, we can have lots of HTML pages using the same CSS stylesheet but simply positioning a different image there with different text.</p>
<p>Now let&#8217;s style the two menus and make our page really start to take shape. To do that we need the following CSS:</p>
<pre name="code" class="css">

ul#menu {
	margin:0px;	padding:0px;
	position:absolute; top:138px; left:75px;
}
ul#right_menu {
	margin:0px;	padding:0px;
	position:absolute; top:138px; right:110px;
}
ul#menu li, ul#right_menu li {
	margin:0px;	padding:0px;
	list-style:none;
	margin-right:10px;
	font-size:9px;
	text-transform:uppercase;
	display:inline;
}
ul#menu li a, ul#right_menu li a {
	text-decoration:none;
	color:#bd92b2;
}
ul#menu li a:hover, ul#right_menu li a:hover {
	text-decoration:none;
	color:#ffffff;
}
</pre>
<p>The first two bits of this code are the same as before (although I adjusted the positions a little to make them look right after styling). Notice that these two definitions are separate as they have different positions, but after that we&#8217;ve combined the two into the same class definitions as the menu items themselves should look the same. The format for defining two classes together is:</p>
<p><strong>.myClass, .myClass2 { &#8230; }</strong></p>
<p>This is very different from this definition:</p>
<p><strong>.myClass .myClass2 { &#8230; }</strong></p>
<p>Because the second definition says, all elements with class=&quot;myClass2&quot; <em>inside</em> an element with class=&quot;myClass&quot;. </p>
<p>Anyhow so back to our styles, let&#8217;s go through some important points:</p>
<ol>
<li>We&#8217;ve set the &lt;ul&gt; elements themselves to 0 margin and padding, and absolute positioning, as we discussed previously</li>
<li>Then we&#8217;ve said for all &lt;li&gt; elements inside those &lt;ul&gt;&#8217;s we want them to have no list-style (i.e. no bullet points), we want them to 9px, all upper case, and importantly they should <strong>display:inline</strong>. Inline display means instead of being blocks that appear one below the next, these will appear<em> next</em> to each other! </li>
<li>The next definition says that for &lt;a&gt; link tags that appear inside an &lt;li&gt; tag that are inside &lt;ul id=&quot;menu&quot;&gt; or &lt;ul id=&quot;right_menu&quot;&gt;, they should be a certain colour and have no underline.</li>
</ol>
<p>And with that, our page is now looking pretty good! </p>
<h4><a href="http://nettuts.s3.amazonaws.com/002_WebBuild/site/step4.html">View The Site So Far</a></h4>
<h3>Step 10</h3>
<p>Next it&#8217;s time to add some content! First let&#8217;s add some dummy text, set up so that we can make columns. Here&#8217;s the HTML:</p>
<pre name="code" class="html">

&lt;div id="outside_container">
	&lt;div id="container">

		&lt;a href="#">&lt;img src="images/logo.jpg" id="logo" />&lt;/a>

        &lt;ul id="menu">
        	&lt;li>&lt;a href="#">Retouching&lt;/a>&lt;/li>
        	&lt;li>&lt;a href="#">Digital Effects&lt;/a>&lt;/li>
        	&lt;li>&lt;a href="#">Web Work&lt;/a>&lt;/li>
		&lt;/ul>

        &lt;ul id="right_menu">
        	&lt;li>&lt;a href="#">About&lt;/a>&lt;/li>
        	&lt;li>&lt;a href="#">Contact&lt;/a>&lt;/li>
        &lt;/ul>

        &lt;img src="images/panel_home.jpg" id="panel" />

		&lt;div id="content">

        	&lt;div class="column1">

            	&lt;h2>a sleek design&lt;/h2>

                &lt;p>Dummy Text: This design was produced for a photoshop and web development tutorial.  You can see the first part up at PSDTUTS.com where you learn how to create a beautiful, but simple design using an abstract background and type.&lt;/p>
				&lt;p>The second part of the tutorial is available via NETTUTS.com where we do a quick build of the PSD into a viable, working HTML/CSS site.&lt;/p>
                &lt;p>This design was produced for a photoshop and web development tutorial.  You can see the first part up at PSDTUTS.com where you learn how to create a beautiful, but simple design using an abstract background and type.&lt;/p>
				&lt;p>The second part of the tutorial is available via NETTUTS.com where we do a quick build of the PSD into a viable, working HTML/CSS site.&lt;/p>

            &lt;/div>
            &lt;div class="column2">

                &lt;h2>tutorials&lt;/h2>

                &lt;p>Dummy Text: This design was produced for a photoshop and web development tutorial.  You can see the first part up at PSDTUTS.com where you learn how to create a beautiful, but simple design using an abstract background and type.&lt;/p>
				&lt;p>The second part of the tutorial is available via NETTUTS.com where we do a quick build of the PSD into a viable, working HTML/CSS site.&lt;/p>
				&lt;p>This design was produced for a photoshop and web development tutorial.  You can see the first part up at PSDTUTS.com where you learn how to create a beautiful, but simple design using an abstract background and type.&lt;/p>
				&lt;p>The second part of the tutorial is available via NETTUTS.com where we do a quick build of the PSD into a viable, working HTML/CSS site.&lt;/p>

            &lt;/div>
            &lt;div class="column3">

            	&lt;h2>recent work&lt;/h2>

                &lt;p>Dummy Text: This design was produced for a photoshop and web development tutorial.  You can see the first part up at PSDTUTS.com where you learn how to create a beautiful, but simple design using an abstract background and type.&lt;/p>
				&lt;p>The second part of the tutorial is available via NETTUTS.com where we do a quick build of the PSD into a viable, working HTML/CSS site.&lt;/p>
				&lt;p>This design was produced for a photoshop and web development tutorial.  You can see the first part up at PSDTUTS.com where you learn how to create a beautiful, but simple design using an abstract background and type.&lt;/p>
				&lt;p>The second part of the tutorial is available via NETTUTS.com where we do a quick build of the PSD into a viable, working HTML/CSS site.&lt;/p>

            &lt;/div>

        &lt;/div>

	&lt;/div>
&lt;/div>
</pre>
<p>OK so in this snippet, you can see I&#8217;ve added 3 new &lt;div&gt;&#8217;s inside the content area. Each one has a &lt;h2&gt; title element and them some text. They have class names column1, column2 and column3. The reason I&#8217;ve added all the extra text is to show you something about making columns.</p>
<p>First let&#8217;s add some CSS to make them appear like columns:</p>
<pre name="code" class="css">

/*
	Content
*/

#content {
	padding-top:435px;
	padding-left:85px;
	width:815px;
	color:#674f5d;
	font-size:13px;
	line-height:20px;
}
.column1 { float:left; width:230px; margin-right:30px; }
.column2 { float:left; width:230px; margin-right:30px; }
.column3 { float:left; width:270px; }
</pre>
<p>As usual I&#8217;ve sectioned off our new bit of CSS with a comment. Then I&#8217;ve set some styles for<strong> #content</strong>. Notice how much padding-top there is &#8230; 435px! This is to make space for all those absolutely positioned elements earlier. Unlike those elements this content area is in the normal flow of the page. </p>
<p>It needs to be in the regular flow because as you add more content to it, it should push the footer down. If this was absolutely positioned it would just go over the top of the footer. </p>
<p>Now the three column classes, notice they are each set with a width and with <strong>float:left</strong>. This tells them that they should drift to the left of the page aligned next to any other left floating elements. I&#8217;ve given the first two a right margin so they aren&#8217;t stuck to each other. </p>
<p>Floating an element makes it drift to the left or right, and tells everything else to wrap around it. When the other elements are also floated, they form into columns. Generally any time you see a column layout, it&#8217;s using floats. </p>
<p>Unfortunately there is one weird problem with floats. Namely that they have a problem with their containers. Instead of pushing the next elements down, they just drift over the top. The way to solve this problem is to have an element that comes after them which has the property <strong>clear:both</strong>.</p>
<p>The Clear property says to stop wrapping stuff around the floating &lt;div&gt;&#8217;s. It&#8217;s a bit hard to explain, so let&#8217;s look at what happens with and without the clearing. </p>
<p><strong>Without Clearing<br />
</strong>Here is how the layout looks as is:</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/002_WebBuild/6.jpg" /></div>
<p>See how the columns have drifted over the top of the footer, and the footer itself has started wrapping around them. That&#8217;s not right!!</p>
<p><strong>With Clearing<br />
</strong>The solution is reasonably simple, we need to add a &lt;div&gt; after the three columns like this:</p>
<pre name="code" class="html">

&lt;div id="content">

    &lt;div class="column1">

        &lt;h2>a sleek design&lt;/h2>

        &lt;p>This design was produced for a photoshop and web development tutorial.  You can see the first part up at PSDTUTS.com where you learn how to create a beautiful, but simple design using an abstract background and type.&lt;/p>
        &lt;p>The second part of the tutorial is available via NETTUTS.com where we do a quick build of the PSD into a viable, working HTML/CSS site.&lt;/p>
        &lt;p>This design was produced for a photoshop and web development tutorial.  You can see the first part up at PSDTUTS.com where you learn how to create a beautiful, but simple design using an abstract background and type.&lt;/p>
        &lt;p>The second part of the tutorial is available via NETTUTS.com where we do a quick build of the PSD into a viable, working HTML/CSS site.&lt;/p>

    &lt;/div>
    &lt;div class="column2">

        &lt;h2>tutorials&lt;/h2>

        &lt;p>This design was produced for a photoshop and web development tutorial.  You can see the first part up at PSDTUTS.com where you learn how to create a beautiful, but simple design using an abstract background and type.&lt;/p>
        &lt;p>The second part of the tutorial is available via NETTUTS.com where we do a quick build of the PSD into a viable, working HTML/CSS site.&lt;/p>
        &lt;p>This design was produced for a photoshop and web development tutorial.  You can see the first part up at PSDTUTS.com where you learn how to create a beautiful, but simple design using an abstract background and type.&lt;/p>
        &lt;p>The second part of the tutorial is available via NETTUTS.com where we do a quick build of the PSD into a viable, working HTML/CSS site.&lt;/p>

    &lt;/div>
    &lt;div class="column3">

        &lt;h2>recent work&lt;/h2>

        &lt;p>This design was produced for a photoshop and web development tutorial.  You can see the first part up at PSDTUTS.com where you learn how to create a beautiful, but simple design using an abstract background and type.&lt;/p>
        &lt;p>The second part of the tutorial is available via NETTUTS.com where we do a quick build of the PSD into a viable, working HTML/CSS site.&lt;/p>
        &lt;p>This design was produced for a photoshop and web development tutorial.  You can see the first part up at PSDTUTS.com where you learn how to create a beautiful, but simple design using an abstract background and type.&lt;/p>
        &lt;p>The second part of the tutorial is available via NETTUTS.com where we do a quick build of the PSD into a viable, working HTML/CSS site.&lt;/p>

    &lt;/div>

    &lt;div style="clear:both">&lt;/div>

&lt;/div>
</pre>
<p>See the &lt;div style=&quot;clear:both&quot;&gt;&lt;/div&gt; down the bottom? It&#8217;s just an empty &lt;div&gt; that says to clear out the three columns. And it fixes our problem, </p>
<h4><a href="http://nettuts.s3.amazonaws.com/002_WebBuild/site/step5.html">View the Site Here.</a></h4>
<p><strong>A Few Last Words on Floats &amp; Clearing Them</strong><br />
You might be wondering why I didn&#8217;t place the &quot;clear:both&quot; into the &lt;div id=&quot;footer&quot;&gt; definition, but unfortunately that doesn&#8217;t work out because of the background we&#8217;re using &#8230; here&#8217;s a screenshot:</p>
<div class="tutorial_image"><img src="http://nettuts.s3.amazonaws.com/002_WebBuild/7.jpg" /></div>
<p>Apparently there is a solution that doesn&#8217;t involve inserting a useless &lt;div&gt; tag, and you can read about it at <a href="http://www.quirksmode.org/css/clearing.html">QuirksMode</a>. Personally I&#8217;ve been using this method for a while, and it works well and consistently so I keep doing it.</p>
<p><h3>Step 11</h3>
<p>OK, almost there now!! The main layout is all sorted, all we have to do is add and style our content. Here&#8217;s the HTML for it:</p>
<pre name="code" class="html">

	&lt;div id="content">

        	&lt;div class="column1">

            	&lt;h2>a sleek design&lt;/h2>

                &lt;p>This design was produced for a photoshop and web development tutorial.  You can see the first part up at PSDTUTS.com where you learn how to create a beautiful, but simple design using an abstract background and type.&lt;/p>
				&lt;p>The second part of the tutorial is available via NETTUTS.com where we do a quick build of the PSD into a viable, working HTML/CSS site.&lt;/p>

            &lt;/div>
            &lt;div class="column2">

                &lt;h2>tutorials&lt;/h2>

                &lt;p>Psdtuts and nettuts provide tutorials on the following topics (sorta):&lt;/p>

                &lt;img src="images/adobe.jpg" />

            &lt;/div>
            &lt;div class="column3">

            	&lt;h2>recent work&lt;/h2>

            	&lt;ul class="work">
                	&lt;li>
                    	&lt;a href="">
                        	&lt;img src="images/work_1.jpg" />
                            &lt;h4>Working Within Limitations to Achieve Great Designs&lt;/h4>
							Sean Hodge
                        &lt;/a>
                    &lt;/li>
                    &lt;li>
                    	&lt;a href="">
                        	&lt;img src="images/work_2.jpg" />
                            &lt;h4>Create a Slick Tabbed Content Area using jQuery&lt;/h4>
							Collis Ta’eed
                        &lt;/a>
                    &lt;/li>
                    &lt;li>
                    	&lt;a href="">
                        	&lt;img src="images/work_3.jpg" />
                            &lt;h4>Creating a PayPal Payment Form&lt;/h4>
							Collis Ta’eed
                        &lt;/a>
                    &lt;/li>
                &lt;/ul>

            &lt;/div>

            &lt;div style="clear:both">&lt;/div>

        &lt;/div>
</pre>
<p>It&#8217;s basically the same structure as previously except in the third column I&#8217;ve created an &lt;ul&gt; element to contain the recent work. Notice that in this &lt;ul&gt; element I&#8217;ve set it up so that there is a link &lt;a&gt; tag wrapping up the image, the heading and the text. So the whole thing will become a block link. That means if you roll over the image, the text associated with it will still change colour. </p>
<p>So here&#8217;s the CSS for our content:</p>
<pre name="code" class="css">

#content h2 {
	font-family:Georgia, "Times New Roman", Times, serif;
	color:#dbaa70;
	margin:0px 0px 20px 0px;
	font-weight:normal;
}

ul.work {
	margin:0px; padding:0px;
}
ul.work li {
	list-style:none;
	margin:0px; padding:0px;
	clear:both;
}
ul.work li a {
	color:#e0b882;
	display:block;
	padding:5px 10px 5px 10px;
	text-decoration:none;
	font-size:10px;
}
ul.work li a img {
	float:left;
	margin-right:20px;
	margin-bottom:20px;
}
ul.work li a h4 {
	color:#674f5d;
	margin:0px;
	font-weight:normal;
	font-size:13px;
}
ul.work li a:hover, ul.work li a:hover h4 { color:#ffffff; }
</pre>
<p>Lets go through the classes one by one:</p>
<ol>
<li>First we are redefining what &lt;h2&gt;&#8217;s that appear inside &lt;div id=&quot;content&quot;&gt; look like. We could have just redefined all &lt;h2&gt;&#8217;s, but you never know when we might have a &lt;h2&gt; that appears somewhere else, so it&#8217;s good practice to be reasonably specific. All I&#8217;ve done here is change the colour, font, weight and margins to make it look the way I need.</li>
<li>Then we have the &lt;ul class=&quot;work&quot;&gt; definitions. The first &lt;ul&gt; definition just gets rid of the margin and padding.</li>
<li>Then the &lt;li&gt; definition says there should be no list-style (i.e. no bullet point). It also says <strong>clear:both</strong>. As you recall from the last step this is to clear floating elements. And if you scan down a little you will notice that the img definition later on has a float. So here we&#8217;re saying each new list element &lt;li&gt; should be clear and not wrapping around parts of the last one. </li>
<li>Next in the &lt;a&gt; part, we&#8217;re saying that the &lt;a&gt; tag should display as a block. That is to say we want our links to be a big block that encloses the image and text. We give it some padding to flesh out the block and set some styles for how text should appear.</li>
<li>Next we say that the &lt;img&gt;&#8217;s inside our &lt;a&gt;&#8217;s should float over to the left with a bit of a margin.</li>
<li>Finally we define the colour of the text in the &lt;h4&gt; bits.</li>
</ol>
<p>And that&#8217;s it! We&#8217;re done!</p>
<h3>Finished!</h3>
<p>And with that the site&#8217;s homepage is complete. You can download a <a href="http://nettuts.s3.amazonaws.com/002_WebBuild/site/site.zip">ZIP of the site files</a> to look through &#8211; it contains the HTML for different stages of this tutorial. And of course you can see the final HTML document:</p>
<h4><a href="http://nettuts.s3.amazonaws.com/002_WebBuild/site/final.html">View the Final Page Here</a></h4>
<p>&nbsp;</p>
<p><em></p>
<h3>Internet Explorer</h3>
<p>Now you should always be doing cross-browser testing.  Alas I have just switched from Windows to a nice new Mac and haven&#8217;t got a Parallels/Win install yet, so I can&#8217;t!  I did a quick check via <a href="http://BrowserShots.org">BrowserShots.org</a> and can see it&#8217;s mostly working fine in IE6/7, however there is a problem with the three columns forcing the footer much further down than they should.  Anyhow should be an easy fix, but until next week when I&#8217;ve installed Windows, IE users you&#8217;re on your own <img src='http://net.tutsplus.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p> I will update here once I&#8217;ve had a chance to iron out the crinkle but I didn&#8217;t want to hold off publishing until then!</p>
<p></em></p>
]]></content:encoded>
			<wfw:commentRss>http://net.tutsplus.com/tutorials/site-builds/build-a-sleek-portfolio-site-from-scratch/feed/</wfw:commentRss>
		<slash:comments>338</slash:comments>
		</item>
	</channel>
</rss>
<!--
This site's performance optimized by W3 Total Cache:

W3 Total Cache improves the user experience of your blog by caching
frequent operations, reducing the weight of various files and providing
transparent content delivery network integration.

Learn more about our WordPress Plugins: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 4/15 queries in 0.015 seconds using memcached
Content Delivery Network via 

Served from: psdtutsplus.com @ 2009-11-21 11:29:19 -->