<?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>DesignM.ag &#187; Tutorials</title>
	<atom:link href="http://designm.ag/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://designm.ag</link>
	<description>Articles and Resources for Web Designers</description>
	<lastBuildDate>Fri, 10 Feb 2012 13:32:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Designing a Custom iPhone App Navigation Bar</title>
		<link>http://designm.ag/tutorials/designing-a-custom-iphone-app-navigation-bar/</link>
		<comments>http://designm.ag/tutorials/designing-a-custom-iphone-app-navigation-bar/#comments</comments>
		<pubDate>Fri, 10 Feb 2012 13:32:16 +0000</pubDate>
		<dc:creator>Jake Rocheleau</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://designm.ag/?p=48221</guid>
		<description><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=48221&c=417413020' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=48221&c=417413020' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>App development for iPhone and iPod Touch has become a booming industry. Designers from all over the world are jumping at the chance to have their ideas published into the App Store. It's no surprise more tech enthusiasts are moving onto Apple devices.</p>

<p>It can be tough to build an entire app from scratch and Xcode menus don't make things easier. In this tutorial I'm hoping to introduce some bare-bones essential ideas for customizing an application's top navigation bar. There is a bit of Objective-C code required but it shouldn't be too overwhelming. It's also worth noting that you will need a computer running Mac OS X in order to install Xcode and compile these apps in the first place.</p>

<p><img src="http://designm.ag/images/jakerocheleau/2012/01/featured-image-custom-nav-bar.jpg" alt="Featured image - custom iPhone app navigation bar" /></p>
<p><strong><a href="http://designm.ag/downloads/iosCustomNavigationBar.zip">Download Source Code</a></strong></p><br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=48221&c=1390567584' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=48221&c=1390567584' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=48221&c=1239616286' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=48221&c=1239616286' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>App development for iPhone and iPod Touch has become a booming industry. Designers from all over the world are jumping at the chance to have their ideas published into the App Store. It&#8217;s no surprise more tech enthusiasts are moving onto Apple devices.</p>
<p>It can be tough to build an entire app from scratch and Xcode menus don&#8217;t make things easier. In this tutorial I&#8217;m hoping to introduce some bare-bones essential ideas for customizing an application&#8217;s top navigation bar. There is a bit of Objective-C code required but it shouldn&#8217;t be too overwhelming. It&#8217;s also worth noting that you will need a computer running Mac OS X in order to install Xcode and compile these apps in the first place.</p>
<p><img src="http://designm.ag/images/jakerocheleau/2012/01/featured-image-custom-nav-bar.jpg" alt="Featured image - custom iPhone app navigation bar" /></p>
<p><strong><a href="http://designm.ag/downloads/iosCustomNavigationBar.zip">Download Source Code</a></strong></p>
<p><span id="more-48221"></span></p>
<h3>Getting Started</h3>
<p>So without too much delay let&#8217;s pop open Xcode! From the main menu create a new project and a series of windows will appear. First you select the application template &#8211; I&#8217;ve chosen <strong>Master-Detail Application</strong> since this already includes a navigation controller.</p>
<p>When building iPhone apps you want to focus on your core functionality and build off the components already available. It&#8217;s pointless to reinvent the wheel and it just requires more of your time. So now hit Next and you&#8217;ll be prompted to give this project a name.</p>
<p><img src="http://designm.ag/images/jakerocheleau/2012/01/master-detail-application-project.jpg" alt="choosing the original project template" /></p>
<p>I set the name <strong>customNavBar</strong> with a company identifier of designmag. The identifier will not affect your application at runtime. It&#8217;s more like metadata to keep track of which applications are published under which developer or studio. If you are building for iOS5 make sure Automatic Reference Counting is checked as well as Storyboards.</p>
<p><img src="http://designm.ag/images/jakerocheleau/2012/01/new-project-title-options.jpg" alt="Naming your new iOS5 Xcode project" /></p>
<p>Hit next, save your new project and we are good to go. Let&#8217;s start out simple by customizing the navigation bar&#8217;s color setting.</p>
<h3>Custom Tint Colors</h3>
<p>In Xcode the left pane window contains all your project files. Inside should be a set of <strong>MasterViewController</strong> .h/.m files. These stand for header and implementation codes which are used to build custom classes.</p>
<p>You don&#8217;t need to understand this concept just yet as it&#8217;s geared more towards software developers. But we will be working within these classes so it&#8217;s good to recognize their purpose. Click once on MasterViewController.m and the source code will appear in your center window.</p>
<p>Now scan the document for a function labeled <tt>viewDidLoad</tt>. This is a default method called on every view once the page first loads. Here&#8217;s a bit of the syntax:</p>
<p><code>- (void)viewDidLoad<br />
{<br />
    // code here<br />
}<br />
</code></p>
<p>Inside the curly braces we want to place a line of code which updates the navigation bar&#8217;s tint color. This value can be set using RGB which I&#8217;ll explain in the next part. But to keep things simple for now we&#8217;ll use the <em>colorRed</em> keyword afforded to us within Cocoa Touch. Here&#8217;s the code I&#8217;m using inside viewDidLoad:</p>
<p><code>[super viewDidLoad];<br />
[self.navigationController.navigationBar setTintColor:[UIColor redColor]];</p>
<p>self.navigationController.title = @"Custom Nav";<br />
</code></p>
<h3>Working the Navigation Controller</h3>
<p>You&#8217;ll notice that Objective-C 2.0 has adopted a dot-syntax similar to JavaScript. You aren&#8217;t expected to fully understand the code above &#8211; it&#8217;s especially deterring to newbies who have never used Xcode before. But when I&#8217;m calling <tt>self.navigationController.navigationBar</tt> it&#8217;s a target to the internal nav bar inside our controller.</p>
<p>Then the <tt>setTintColor</tt> method will change the styles of all buttons and elements inside the navigation bar. You may also notice I&#8217;ve set the navigation controller&#8217;s <strong>title</strong> property. This is just a plain string of text which appears at the top of your page view.</p>
<p><img src="http://designm.ag/images/jakerocheleau/2012/01/red-tinted-navigation-bar.jpg" alt="tinted navigation bar to red" /></p>
<p>Build and run the application with CMD+R or click the play button in the top left corner. This will open the iOS Simulator so you can catch a glimpse of how the app will function on a mobile screen. This method works and it&#8217;s a great place to start.</p>
<p>However I want to include just a bit more code so that we can use a custom image as the navigation background instead. Quit the simulator for now and let&#8217;s pop back into Xcode.</p>
<h3>Creating BG Graphics</h3>
<p>To save a bit of time I&#8217;ve already put together the background images in Photoshop. I&#8217;m using a similar design pattern as <a href="http://dribbble.com/shots/153151-Indigo-Nav-Bar">this indigo nav bar</a> created originally by <a href="http://dribbble.com/jmulkey">Jonathan Mulkey</a>. He is a very talented app designer based out of Tennessee.</p>
<p>It&#8217;s worth mentioning that we need to create two(2) different image files for the background. Regular iPhone 3/3GS users are on the standard 320&#215;480 pixel grid. However the iPhone 4/4S uses a 640&#215;960 grid fitted into the same physical screen size. This means 1 point = 2 pixels and our images will look much more crisp.</p>
<ul>
<li><a href="http://designm.ag/previews/iphone-navigation-bar/CustomNavBG.png">CustomNavBG.png</a> (320x44px)</li>
<li><a href="http://designm.ag/previews/iphone-navigation-bar/CustomNavBG@2x.png">CustomNavBG@2x.png</a> (640x88px)</li>
</ul>
<p>iOS dev guidelines require that both images are saved under the same name with the larger retina image title appending &#8220;@2x&#8221; on the end. In our code we will only reference <strong>CustomNavBG.png</strong>. The Cocoa framework is smart enough to detect when a user is on a retina device and will automatically fill the @2x version instead.</p>
<h3>Implementing the Background</h3>
<p>The fastest and most proper way to accomplish a custom navigation background is to build a new UINavigationBar subclass. I know this sounds a bit confusing but it&#8217;s really a lot simpler than you think.</p>
<p><img src="http://designm.ag/images/jakerocheleau/2012/01/creating-new-file.jpg" alt="creating a new file in Xcode 4.2" /></p>
<p>Right-click(or control+click) on your project in the left pane and select New File. We want an Objective-C Class with a subclass of <strong>UINavigationBar</strong>. If this isn&#8217;t offered in the dropdown menu just manually type it in. You can name this class whatever you&#8217;d like &#8211; I chose <strong>CustomNavBar</strong>. Hit &#8220;Next&#8221; and you&#8217;ll end up with a new set of .h/.m files in your project.</p>
<p>All we want to do is overwrite a method named <tt>drawRect</tt>. This is used to create the original background gradient for any default navigation bar. I&#8217;ve added my code below for both of the .h and .m files. It should work perfectly if you copy/paste into your own assuming you are using the same class name.</p>
<p><code># CustomNavBar.h codes<br />
@interface CustomNavBar : UINavigationBar</p>
<p>@end</p>
<p>#CustomNavBar.m codes<br />
@implementation CustomNavBar</p>
<p>- (void)drawRect:(CGRect)rect {<br />
	UIImage *image = [UIImage imageNamed:@"CustomNavBG.png"];<br />
	[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];<br />
}</p>
<p>@end<br />
</code></p>
<p>Save any changes in both of these files and then click onto your MainStoryboard.storyboard. This contains all the different views within the application. At the very far left is a Navigation Controller and this is what we&#8217;re targeting. Click on the top blue bar and open your <strong>Identity Inspector</strong>(View -&gt; Utilities -&gt; Show Identity Inspector). This should appear in the right-hand window pane.</p>
<p><img src="http://designm.ag/images/jakerocheleau/2012/01/identity-inspector-custom-class.jpg" alt="setting the custom UINavigationBar class" /></p>
<p>Within this new window you should see a class setting with the value UINavigationBar. You want to change this to <strong>CustomNavBar</strong> or whatever you named your class files in the previous step. Now the navigation bar is pulling from our custom code instead of the default iOS bar.</p>
<h3>Build &amp; Run!</h3>
<p>If you run the application now you&#8217;ll notice our top nav bar is pulling in the background image. Success! But the only problem is when you tap on the table cell it loads a new view which uses a back button. This back button is still colored by the red tint we were using earlier.</p>
<p><img src="http://designm.ag/images/jakerocheleau/2012/01/red-back-button-tint.jpg" alt="hideous red-tinted back button" /></p>
<p>Luckily this is a simple fix. We just need to match a purple/grey color from the background image and use this as our new tint. Click back into MasterViewController.m and find the previous code inside viewDidLoad. I&#8217;ve taken the liberty of grabbing an RGB value which fits this background color and set each to different variables. Below is my new tint code:</p>
<p><code>NSInteger red   = 95;<br />
NSInteger green = 100;<br />
NSInteger blue  = 130;</p>
<p>[self.navigationController.navigationBar setTintColor:[UIColor colorWithRed:red/255.0f green:green/255.0f blue:blue/255.0f alpha:1.0]];<br />
</code></p>
<p>We place each color value over the max of 255 and this returns a floating integer. Strictly speaking this is the easiest way to convert RGB from Photoshop into a color in Objective-C. Save and run the project again and you should see much nicer results.</p>
<p><img src="http://designm.ag/images/jakerocheleau/2012/01/recolored-back-button-tint.jpg" alt="recolored button tint" /></p>
<p><strong><a href="http://designm.ag/downloads/iosCustomNavigationBar.zip">Download Source Code</a></strong></p>
<h3>Conclusion</h3>
<p>If you&#8217;ve having any trouble be sure to download my demo source code for this project. I&#8217;m using Xcode 4.2 with iOS5 which may not convert perfectly down to older versions. But for beginner iOS developers this tutorial should give you a bit of insight into building and customizing your own apps. It&#8217;s a truly challenging skill to master yet very rewarding in the long term.</p>
<br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=48221&c=164094075' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=48221&c=164094075' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></content:encoded>
			<wfw:commentRss>http://designm.ag/tutorials/designing-a-custom-iphone-app-navigation-bar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>45 Useful Photoshop Tutorials From 2011</title>
		<link>http://designm.ag/tutorials/45-useful-photoshop-tutorials-from-2011/</link>
		<comments>http://designm.ag/tutorials/45-useful-photoshop-tutorials-from-2011/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 16:23:00 +0000</pubDate>
		<dc:creator>Brant Wilson</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://designm.ag/?p=47737</guid>
		<description><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=47737&c=596790684' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=47737&c=596790684' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br />In this roundup we have collected 45 outstanding Photoshop tutorials released in 2011. If you like these photoshop tutorials you might also want to check out some of our previous posts below. Enjoy!

<a href="http://designm.ag/inspiration/35-amazing-photo-effect-photoshop-tutorials/">35 Amazing Photo Effect Photoshop Tutorials</a>

<a href="http://designm.ag/resources/30-awesome-photoshop-text-effect-tutorials/">30 Awesome Photoshop Text Effect Tutorials</a>

<a href="http://psd.tutsplus.com/tutorials/photo-effects-tutorials/human-disintegration-effect/">Create a Powerful Human Disintegration Effect in Photoshop</a>
<a href="http://psd.tutsplus.com/tutorials/photo-effects-tutorials/human-disintegration-effect/"><img class="alignnone size-full wp-image-47738" src="http://designm.ag/wp-content/uploads/2011/12/110.jpg" alt="" width="570" height="758" /></a><br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=47737&c=1433620511' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=47737&c=1433620511' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=47737&c=318621475' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=47737&c=318621475' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>In this roundup we have collected 45 outstanding Photoshop tutorials released in 2011. If you like these photoshop tutorials you might also want to check out some of our previous posts below. Enjoy!</p>
<p><a href="http://designm.ag/inspiration/35-amazing-photo-effect-photoshop-tutorials/">35 Amazing Photo Effect Photoshop Tutorials</a></p>
<p><a href="http://designm.ag/resources/30-awesome-photoshop-text-effect-tutorials/">30 Awesome Photoshop Text Effect Tutorials</a></p>
<p><a href="http://psd.tutsplus.com/tutorials/photo-effects-tutorials/human-disintegration-effect/">Create a Powerful Human Disintegration Effect in Photoshop</a><br />
<a href="http://psd.tutsplus.com/tutorials/photo-effects-tutorials/human-disintegration-effect/"><img class="alignnone size-full wp-image-47738" src="http://designm.ag/wp-content/uploads/2011/12/110.jpg" alt="" width="570" height="758" /></a></p>
<p><a href="http://psd.tutsplus.com/tutorials/icon-design/futuristic-bicycle-icon/">Create a Futuristic Bicycle Icon in Photoshop</a><br />
<a href="http://psd.tutsplus.com/tutorials/icon-design/futuristic-bicycle-icon/"><img class="alignnone size-full wp-image-47739" src="http://designm.ag/wp-content/uploads/2011/12/210.jpg" alt="" width="570" height="352" /></a></p>
<p><a href="http://psd.tutsplus.com/tutorials/icon-design/detailed-audio-receiver-icon/">Design a Detailed Audio Receiver Icon in Photoshop</a><br />
<a href="http://psd.tutsplus.com/tutorials/icon-design/detailed-audio-receiver-icon/"><img class="alignnone size-full wp-image-47740" src="http://designm.ag/wp-content/uploads/2011/12/32.jpg" alt="" width="570" height="315" /></a></p>
<p><a href="http://psd.tutsplus.com/tutorials/painting/medieval-landscape-photoshop/">Create a Medieval Landscape in Photoshop</a><br />
<a href="http://psd.tutsplus.com/tutorials/painting/medieval-landscape-photoshop/"><img class="alignnone size-full wp-image-47741" src="http://designm.ag/wp-content/uploads/2011/12/41.jpg" alt="" width="570" height="755" /></a></p>
<p><a href="http://psd.tutsplus.com/tutorials/drawing/character-design-boomrock-saints/">Character Design for the Boomrock Saints</a><br />
<a href="http://psd.tutsplus.com/tutorials/drawing/character-design-boomrock-saints/"><img class="alignnone size-full wp-image-47742" src="http://designm.ag/wp-content/uploads/2011/12/51.jpg" alt="" width="570" height="448" /></a></p>
<p><a href="http://psd.tutsplus.com/tutorials/text-effects-tutorials/cool-typography-photoshop/">Create “Cool” Typography Using Paths in Photoshop</a><br />
<a href="http://psd.tutsplus.com/tutorials/text-effects-tutorials/cool-typography-photoshop/"><img class="alignnone size-full wp-image-47743" src="http://designm.ag/wp-content/uploads/2011/12/61.jpg" alt="" width="570" height="478" /></a></p>
<p><a href="http://psd.tutsplus.com/tutorials/photo-effects-tutorials/cityscape-concept-art/">How to Create Cityscape Concept Art</a><br />
<a href="http://psd.tutsplus.com/tutorials/photo-effects-tutorials/cityscape-concept-art/"><img class="alignnone size-full wp-image-47744" src="http://designm.ag/wp-content/uploads/2011/12/71.jpg" alt="" width="570" height="811" /></a></p>
<p><a href="http://psd.tutsplus.com/tutorials/illustration/lamp/">Use Photoshop to Create a Still-Life Lamp, Nightstand, and Picture Frame</a><br />
<a href="http://psd.tutsplus.com/tutorials/illustration/lamp/"><img class="alignnone size-full wp-image-47745" src="http://designm.ag/wp-content/uploads/2011/12/81.jpg" alt="" width="570" height="745" /></a></p>
<p><a href="http://psd.tutsplus.com/tutorials/designing-tutorials/album-cover/">Design a Conceptual Album Cover in Photoshop</a><br />
<a href="http://psd.tutsplus.com/tutorials/designing-tutorials/album-cover/"><img class="alignnone size-full wp-image-47746" src="http://designm.ag/wp-content/uploads/2011/12/91.jpg" alt="" width="570" height="509" /></a></p>
<p><a href="http://psd.tutsplus.com/tutorials/3d/3d-spray-can/">How to Make a Textured 3D Spray Can</a><br />
<a href="http://psd.tutsplus.com/tutorials/3d/3d-spray-can/"><img class="alignnone size-full wp-image-47747" src="http://designm.ag/wp-content/uploads/2011/12/101.jpg" alt="" width="570" height="757" /></a></p>
<p><a href="http://psd.tutsplus.com/tutorials/designing-tutorials/blister-packaging/">Mockup Blister Packaging in Photoshop</a><br />
<a href="http://psd.tutsplus.com/tutorials/designing-tutorials/blister-packaging/"><img class="alignnone size-full wp-image-47748" src="http://designm.ag/wp-content/uploads/2011/12/111.jpg" alt="" width="570" height="568" /></a></p>
<p><a href="http://psd.tutsplus.com/tutorials/photo-effects-tutorials/remove-giraffe-spots-photoshop/">Undress a Giraffe in Photoshop</a><br />
<a href="http://psd.tutsplus.com/tutorials/photo-effects-tutorials/remove-giraffe-spots-photoshop/"><img class="alignnone size-full wp-image-47749" src="http://designm.ag/wp-content/uploads/2011/12/122.jpg" alt="" width="570" height="758" /></a></p>
<p><a href="http://photoshoptutorials.ws/photoshop-tutorials/photo-manipulation/how-to-create-dramatic-sci-fi-photo-manipulation-in-photoshop.html">How to Create Dramatic Sci-Fi Photo Manipulation in Photoshop</a><br />
<a href="http://photoshoptutorials.ws/photoshop-tutorials/photo-manipulation/how-to-create-dramatic-sci-fi-photo-manipulation-in-photoshop.html"><img class="alignnone size-full wp-image-47750" src="http://designm.ag/wp-content/uploads/2011/12/131.jpg" alt="" width="570" height="380" /></a></p>
<p><a href="http://photoshoptutorials.ws/photoshop-tutorials/photo-manipulation/how-to-create-an-out-of-this-world-medieval-fantasy-themed-photo-manipulation.html">How to Create an Out of This World, Medieval-Fantasy Themed Photo Manipulation</a><br />
<a href="http://photoshoptutorials.ws/photoshop-tutorials/photo-manipulation/how-to-create-an-out-of-this-world-medieval-fantasy-themed-photo-manipulation.html"><img class="alignnone size-full wp-image-47751" src="http://designm.ag/wp-content/uploads/2011/12/142.jpg" alt="" width="570" height="321" /></a></p>
<p><a href="http://psd.tutsplus.com/tutorials/photo-effects-tutorials/snow-frog/">Create a Fictional Arctic Snow Frog in Photoshop</a><br />
<a href="http://psd.tutsplus.com/tutorials/photo-effects-tutorials/snow-frog/"><img class="alignnone size-full wp-image-47752" src="http://designm.ag/wp-content/uploads/2011/12/151.jpg" alt="" width="570" height="427" /></a></p>
<p><a href="http://photoshoptutorials.ws/photoshop-tutorials/photo-manipulation/how-to-create-feet-shoes-in-photoshop.html">How to Create Feet Shoes in Photoshop</a><br />
<a href="http://photoshoptutorials.ws/photoshop-tutorials/photo-manipulation/how-to-create-feet-shoes-in-photoshop.html"><img class="alignnone size-full wp-image-47753" src="http://designm.ag/wp-content/uploads/2011/12/161.jpg" alt="" width="570" height="830" /></a></p>
<p><a href="http://photoshoptutorials.ws/photoshop-tutorials/photo-manipulation/create-an-intense-wings-of-fire-photo-manipulation.html">Create an Intense “Wings of Fire” Photo Manipulation</a><br />
<a href="http://photoshoptutorials.ws/photoshop-tutorials/photo-manipulation/create-an-intense-wings-of-fire-photo-manipulation.html"><img class="alignnone size-full wp-image-47754" src="http://designm.ag/wp-content/uploads/2011/12/171.jpg" alt="" width="570" height="570" /></a></p>
<p><a href="http://photoshoptutorials.ws/photoshop-tutorials/text-effects/design-a-retro-typography-poster-in-photoshop.html">Design a Retro Typography Poster in Photoshop</a><br />
<a href="http://photoshoptutorials.ws/photoshop-tutorials/text-effects/design-a-retro-typography-poster-in-photoshop.html"><img class="alignnone size-full wp-image-47755" src="http://designm.ag/wp-content/uploads/2011/12/181.jpg" alt="" width="570" height="806" /></a></p>
<p><a href="http://photoshoptutorials.ws/photoshop-tutorials/photo-manipulation/create-an-explosive-flaming-poker-card-in-photoshop.html">Create an Explosive Flaming Poker Card in Photoshop</a><br />
<a href="http://photoshoptutorials.ws/photoshop-tutorials/photo-manipulation/create-an-explosive-flaming-poker-card-in-photoshop.html"><img class="alignnone size-full wp-image-47756" src="http://designm.ag/wp-content/uploads/2011/12/191.jpg" alt="" width="570" height="356" /></a></p>
<p><a href="http://photoshoptutorials.ws/photoshop-tutorials/photo-effects/how-to-make-your-photos-look-hipster-with-photoshop.html">How to Make Your Photos Look Hipster with Photoshop</a><br />
<a href="http://photoshoptutorials.ws/photoshop-tutorials/photo-effects/how-to-make-your-photos-look-hipster-with-photoshop.html"><img class="alignnone size-full wp-image-47757" src="http://designm.ag/wp-content/uploads/2011/12/201.jpg" alt="" width="570" height="379" /></a></p>
<p><a href="http://designinstruct.com/drawing-illustration/develop-illustration-photoshop/">How to Develop a Handmade Illustration with Photoshop</a><br />
<a href="http://designinstruct.com/drawing-illustration/develop-illustration-photoshop/"><img class="alignnone size-full wp-image-47758" src="http://designm.ag/wp-content/uploads/2011/12/211.jpg" alt="" width="570" height="760" /></a></p>
<p><a href="http://designinstruct.com/graphic-design/design-a-vintage-baseball-card-in-photoshop/">Design a Vintage Baseball Card in Photoshop</a><br />
<a href="http://designinstruct.com/graphic-design/design-a-vintage-baseball-card-in-photoshop/"><img class="alignnone size-full wp-image-47759" src="http://designm.ag/wp-content/uploads/2011/12/221.jpg" alt="" width="570" height="712" /></a></p>
<p><a href="http://designinstruct.com/drawing-illustration/how-to-draw-a-classic-electric-guitar-in-photoshop/">How to Draw a Classic Electric Guitar in Photoshop</a><br />
<a href="http://designinstruct.com/drawing-illustration/how-to-draw-a-classic-electric-guitar-in-photoshop/"><img class="alignnone size-full wp-image-47760" src="http://designm.ag/wp-content/uploads/2011/12/231.jpg" alt="" width="570" height="857" /></a></p>
<p><a href="http://wegraphics.net/blog/tutorials/create-a-detailed-vintage-tv-from-scratch-in-photoshop/">Create a Detailed Vintage TV from Scratch in Photoshop</a><br />
<a href="http://wegraphics.net/blog/tutorials/create-a-detailed-vintage-tv-from-scratch-in-photoshop/"><img class="alignnone size-full wp-image-47761" src="http://designm.ag/wp-content/uploads/2011/12/241.jpg" alt="" width="570" height="429" /></a></p>
<p><a href="http://designinstruct.com/graphic-design/design-a-retro-postcard-with-3d-text/">Design a Retro Postcard with 3D Text</a><br />
<a href="http://designinstruct.com/graphic-design/design-a-retro-postcard-with-3d-text/"><img class="alignnone size-full wp-image-47762" src="http://designm.ag/wp-content/uploads/2011/12/251.jpg" alt="" width="570" height="311" /></a></p>
<p><a href="http://wegraphics.net/blog/tutorials/vintage-circus-poster-with-the-photoshop-puppet-warp-tool/">How to Create a Vintage Circus Poster with the Photoshop Puppet Warp Tool</a><br />
<a href="http://wegraphics.net/blog/tutorials/vintage-circus-poster-with-the-photoshop-puppet-warp-tool/"><img class="alignnone size-full wp-image-47763" src="http://designm.ag/wp-content/uploads/2011/12/261.jpg" alt="" width="570" height="761" /></a></p>
<p><a href="http://wegraphics.net/blog/tutorials/make-a-retro-space-themed-poster-in-photoshop/">Make a Retro Space Themed Poster in Photoshop</a><br />
<a href="http://wegraphics.net/blog/tutorials/make-a-retro-space-themed-poster-in-photoshop/"><img class="alignnone size-full wp-image-47764" src="http://designm.ag/wp-content/uploads/2011/12/271.jpg" alt="" width="570" height="847" /></a></p>
<p><a href="http://wegraphics.net/blog/tutorials/making-a-superhero-movie-teaser-poster/">Making a Superhero Movie Teaser Poster</a><br />
<a href="http://wegraphics.net/blog/tutorials/making-a-superhero-movie-teaser-poster/"><img class="alignnone size-full wp-image-47765" src="http://designm.ag/wp-content/uploads/2011/12/281.jpg" alt="" width="570" height="810" /></a></p>
<p><a href="http://wegraphics.net/blog/tutorials/create-an-ice-cream-type-treatment-in-photoshop/">Create an Ice Cream Type Treatment in Photoshop</a><br />
<a href="http://wegraphics.net/blog/tutorials/create-an-ice-cream-type-treatment-in-photoshop/"><img class="alignnone size-full wp-image-47766" src="http://designm.ag/wp-content/uploads/2011/12/291.jpg" alt="" width="570" height="370" /></a></p>
<p><a href="http://abduzeedo.com/nike-hair-photoshop">Nike Hair in Photoshop</a><br />
<a href="http://abduzeedo.com/nike-hair-photoshop"><img class="alignnone size-full wp-image-47767" src="http://designm.ag/wp-content/uploads/2011/12/301.jpg" alt="" width="570" height="264" /></a></p>
<p><a href="http://abduzeedo.com/reader-tutorial-flaming-car-lincoln-soares">Flaming Car in Photoshop by Lincoln Soares</a><br />
<a href="http://abduzeedo.com/reader-tutorial-flaming-car-lincoln-soares"><img class="alignnone size-full wp-image-47768" src="http://designm.ag/wp-content/uploads/2011/12/311.jpg" alt="" width="570" height="264" /></a></p>
<p><a href="http://abduzeedo.com/easy-3d-globe-photoshop">Easy 3D Globe in Photoshop</a><br />
<a href="http://abduzeedo.com/easy-3d-globe-photoshop"><img class="alignnone size-full wp-image-47769" src="http://designm.ag/wp-content/uploads/2011/12/321.jpg" alt="" width="570" height="264" /></a></p>
<p><a href="http://abduzeedo.com/captain-america-shield-photoshop">Captain America Shield in Photoshop</a><br />
<a href="http://abduzeedo.com/captain-america-shield-photoshop"><img class="alignnone size-full wp-image-47770" src="http://designm.ag/wp-content/uploads/2011/12/33.jpg" alt="" width="570" height="580" /></a></p>
<p><a href="http://abduzeedo.com/awesome-amp-controls-photoshop">Awesome Amp Controls in Photoshop</a><br />
<a href="http://abduzeedo.com/awesome-amp-controls-photoshop"><img class="alignnone size-full wp-image-47771" src="http://designm.ag/wp-content/uploads/2011/12/34.jpg" alt="" width="570" height="388" /></a></p>
<p><a href="http://abduzeedo.com/dark-knight-rises-poster-photoshop">Dark Knight Rises Poster in Photoshop</a><br />
<a href="http://abduzeedo.com/dark-knight-rises-poster-photoshop"><img class="alignnone size-full wp-image-47772" src="http://designm.ag/wp-content/uploads/2011/12/35.jpg" alt="" width="570" height="783" /></a></p>
<p><a href="http://webexpedition18.com/work/design-a-vintage-style-swissair-travel-poster-in-photoshop/">Design a Vintage Style Swissair Travel Poster In Photoshop</a><br />
<a href="http://webexpedition18.com/work/design-a-vintage-style-swissair-travel-poster-in-photoshop/"><img class="alignnone size-full wp-image-47773" src="http://designm.ag/wp-content/uploads/2011/12/361.jpg" alt="" width="570" height="808" /></a></p>
<p><a href="http://photoshoptutorials.ws/photoshop-tutorials/photo-manipulation/piece-of-the-artic-pie-chart-photo-manipulation.html">“Piece of the Artic” Pie Chart Photo Manipulation</a><br />
<a href="http://photoshoptutorials.ws/photoshop-tutorials/photo-manipulation/piece-of-the-artic-pie-chart-photo-manipulation.html"><img class="alignnone size-full wp-image-47774" src="http://designm.ag/wp-content/uploads/2011/12/37.jpg" alt="" width="570" height="379" /></a></p>
<p><a href="http://www.digitalartsonline.co.uk/tutorials/?featureID=3321241">ERODED FASHION PORTRAITS</a><br />
<a href="http://www.digitalartsonline.co.uk/tutorials/?featureID=3321241"><img class="alignnone size-full wp-image-47775" src="http://designm.ag/wp-content/uploads/2011/12/38.jpg" alt="" width="570" height="864" /></a></p>
<p><a href="http://www.digitalartsonline.co.uk/tutorials/?featureID=3293688">CREATE SUPER PSYCHEDELIC ARTWORK</a><br />
<a href="http://www.digitalartsonline.co.uk/tutorials/?featureID=3293688"><img class="alignnone size-full wp-image-47776" src="http://designm.ag/wp-content/uploads/2011/12/391.jpg" alt="" width="570" height="798" /></a></p>
<p><a href="http://www.digitalartsonline.co.uk/tutorials/?featureID=3321260">PAINT A MULTILAYERED SURREAL PORTRAIT</a><br />
<a href="http://www.digitalartsonline.co.uk/tutorials/?featureID=3321260"><img class="alignnone size-full wp-image-47777" src="http://designm.ag/wp-content/uploads/2011/12/401.jpg" alt="" width="570" height="817" /></a></p>
<p><a href="http://www.digitalartsonline.co.uk/tutorials/?featureID=3305776">GIVE A PORTRAIT A COSMIC MAKEOVER</a><br />
<a href="http://www.digitalartsonline.co.uk/tutorials/?featureID=3305776"><img class="alignnone size-full wp-image-47778" src="http://designm.ag/wp-content/uploads/2011/12/411.jpg" alt="" width="570" height="806" /></a></p>
<p><a href="http://psd.tutsplus.com/tutorials/photo-effects-tutorials/blueprint-photosop/">Create a Realistic Blueprint Image From a 3D Object</a><br />
<a href="http://psd.tutsplus.com/tutorials/photo-effects-tutorials/blueprint-photosop/"><img class="alignnone size-full wp-image-47779" src="http://designm.ag/wp-content/uploads/2011/12/42.jpg" alt="" width="570" height="427" /></a></p>
<p><a href="http://www.digitalartsonline.co.uk/tutorials/?featureID=3283305">TYPE THAT’S FIT TO EAT</a><br />
<a href="http://www.digitalartsonline.co.uk/tutorials/?featureID=3283305"><img class="alignnone size-full wp-image-47780" src="http://designm.ag/wp-content/uploads/2011/12/43.jpg" alt="" width="570" height="811" /></a></p>
<p><a href="http://design.creativefan.com/vintage-typography-tutorial/">Vintage Typography Tutorial using Ornamental Styles</a><br />
<a href="http://design.creativefan.com/vintage-typography-tutorial/"><img class="alignnone size-full wp-image-47781" src="http://designm.ag/wp-content/uploads/2011/12/44.jpg" alt="" width="570" height="700" /></a></p>
<p><a href="http://design.creativefan.com/manipulate-a-dancer-illustration-in-photoshop/">Manipulate a Dancer Illustration in Photoshop</a><br />
<a href="http://design.creativefan.com/manipulate-a-dancer-illustration-in-photoshop/"><img class="alignnone size-full wp-image-47782" src="http://designm.ag/wp-content/uploads/2011/12/45.jpg" alt="" width="570" height="380" /></a></p>
<br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=47737&c=1012215099' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=47737&c=1012215099' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></content:encoded>
			<wfw:commentRss>http://designm.ag/tutorials/45-useful-photoshop-tutorials-from-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Properly Design a Print CSS Stylesheet</title>
		<link>http://designm.ag/tutorials/how-to-properly-design-a-print-css-stylesheet/</link>
		<comments>http://designm.ag/tutorials/how-to-properly-design-a-print-css-stylesheet/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 14:41:07 +0000</pubDate>
		<dc:creator>Jake Rocheleau</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://designm.ag/?p=47843</guid>
		<description><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=47843&c=1232095267' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=47843&c=1232095267' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>Targeting unique CSS styles is a simple process based around media queries. Web designers have been using these techniques for years to much success. Yet in just a short couple of years recently stylesheets have grown in tremendous popularity. Now more than ever it's important to offer not only mobile but print layouts for your visitors.</p>

<p>I've put together this small guide for beginners to quickly craft a print-based design. There are standard concepts and layout techniques you should utilize for quicker loading speeds. You also need to be conscious of page length when the design is printed on paper.</p>

<p><a href="http://www.flickr.com/photos/slinky/49481797/"><img src="http://designm.ag/wp-content/uploads/2011/12/printer-paper-css-stylesheet.jpg" /></a></p><br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=47843&c=107829149' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=47843&c=107829149' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=47843&c=1300955020' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=47843&c=1300955020' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>Targeting unique CSS styles is a simple process based around media queries. Web designers have been using these techniques for years to much success. Yet in just a short couple of years recently stylesheets have grown in tremendous popularity. Now more than ever it&#8217;s important to offer not only mobile but print layouts for your visitors.</p>
<p>I&#8217;ve put together this small guide for beginners to quickly craft a print-based design. There are standard concepts and layout techniques you should utilize for quicker loading speeds. You also need to be conscious of page length when the design is printed on paper.</p>
<p><a href="http://www.flickr.com/photos/slinky/49481797/"><img src="http://designm.ag/wp-content/uploads/2011/12/printer-paper-css-stylesheet.jpg" /></a></p>
<p><span id="more-47843"></span></p>
<h3>Web v. Print Design</h3>
<p>We should start off taking a quick look into both areas. These are two completely different design studies which are frequently secluded from each other. But printers are much more common in the everyday household &#8211; so it&#8217;s not strange for your visitors to expect pages to print nicely.</p>
<p>Unfortunately you are working with much less space on a plain white sheet of paper. This means oftentimes your layout will contort in very strange ways. You&#8217;ll have to be considerate of dynamic content including image galleries, content sliders, tabbed divs, and so forth. You almost need to build a mobile-based template but with even less functionality! Visitors won&#8217;t need any of it on the printed layout anyways.</p>
<p><a href="http://www.flickr.com/photos/bradb/6292613077/"><img src="http://designm.ag/wp-content/uploads/2011/12/iphone-white-4s.jpg" alt="White iPhone 4S Graphic" /></a></p>
<p>But this doesn&#8217;t intrinsically mean you should remove all other media from the page. My recommendation is to keep images within the main content, plus your logo, but remove them elsewhere deemed a distraction. It&#8217;s best to remove entire areas of your layout which don&#8217;t serve a purpose in print &#8211; such as sidebar(s) or an extended footer.</p>
<h3>Plain White Backgrounds</h3>
<p>This is a crucial topic to mention right from the start. Nobody enjoys wasting their ink, and colored backgrounds in your page will do just that. Make sure you remove all repeating images, background textures, and preferably all solid color BGs as well. Even printing in black and white can make content difficult to read with a multi-colored background.</p>
<p>Obviously the solution is plain white, which will work the best in practically every situation. If you have trouble overwriting the default styles include <a href="http://coding.smashingmagazine.com/2010/11/02/the-important-css-declaration-how-and-when-to-use-it/">!important declarations</a> into your print CSS code. Also use this if needed to ensure all text is dark enough to read. Keeping everything plain and simple is generally the best strategy.</p>
<h3>Identify the Key Elements</h3>
<p>Ponder a bit and consider why your visitors would even be printing out your web pages. Would it be for reading material, or maybe part of an image gallery? This is important since you&#8217;ll want to manipulate your layout in such a strategic way.</p>
<p><a href="http://www.flickr.com/photos/dennischeatham/6018649433/"><img src="http://designm.ag/wp-content/uploads/2011/12/responsive-web-design-menu.jpg" alt="Responsive Web Design - Screen Sizing" /></a></p>
<p>As an example you may have a sidebar which only holds a small navigation menu, ads, and a signup form. None of these elements are helpful to the printed version of your content &#8211; so why not hide the sidebar altogether? Using the CSS <em>display: none;</em> property you can totally remove certain aspects of your page. Similarly you could widen the main content area so text will fill up more space, thus printing out less pages.</p>
<p>For some websites it may be too much work to recreate an entire stylesheet from scratch. This is especially true if you visitors wouldn&#8217;t mind keeping the same layout in printed form with just a few minor changes. For this task you can incorporate CSS media queries which target print devices only.</p>
<h3>Stand-Out Links</h3>
<p>Hyperlinks will surely be sprinkled all about your documents. These aren&#8217;t entirely important in printed context, but you should keep them distinguished just in case people re-visit your website looking for more reading. You could stick with the standard blue/purple colors which also appear great in black &amp; white print.</p>
<p><a href="http://www.flickr.com/photos/adactio/5818108965/"><img src="http://designm.ag/wp-content/uploads/2011/12/a-book-apart-ala.jpg" alt="A Book Apart - A List Apart Publishing" /></a></p>
<p>Believe it or not we can also manipulate <a href="http://www.alistapart.com/articles/goingtoprint/">direct hyperlink URLs</a> right into the page using CSS2+ properties in compliant browsers. A List Apart provides some good code examples of this even using relative URL schemes(ie. <em>/articles/2011/mypost.html</em>).</p>
<p><code>body a:link:after, body a:visited:after {<br />
   content: " (" attr(href) ") ";<br />
   font-size: 10%;<br />
   }<br />
</code></p>
<p>This will insert both parentheses in quotation marks and the href value directly after the hyperlink text. It&#8217;s a great way to provide printer-friendly support for links on your website. Note that for this to work properly you should be using full URLs which include the root domain of your site.</p>
<h3>Using CSS Media</h3>
<p>To first clarify there is a difference between the @media query and the HTML media attribute. Both of these delineate between printed CSS code, but @media is included within the document itself.</p>
<p><code>&lt;link rel="alternate stylesheet" href="css/print.css" type="text/css" media="print" /&gt;</code></p>
<p>In the example above we&#8217;re looking at an alternative stylesheet which you would include into your document header. The media attribute means these styles will only be applied when the page goes through a print action. So you won&#8217;t actually be able to test these without printing a live copy. But how else could you check the results realistically?</p>
<p><code>&lt;style type="text/css"&gt;<br />
    @import url("css/print.css") print;<br />
&lt;/style&gt;</code></p>
<p>If you&#8217;re trying to keep print styles running in modern browsers you could also use the <em>@import</em> statement. This is just another alternate way of including print-specific code. But you won&#8217;t be mixing up alternate stylesheets as this bit of code is overlooked in legacy browsers.</p>
<p><a href="http://www.flickr.com/photos/fotopakismo/1413234072/"><img src="http://designm.ag/wp-content/uploads/2011/12/japan-tokyo-bay-highway.jpg" alt="Night time in Tokyo" /></a></p>
<p>Otherwise <a href="http://www.w3schools.com/css/css_mediatypes.asp">CSS Media</a> is definitely an option, albeit targeted towards thinner stylesheets. These media queries can be included directly into your default stylesheet &#8211; so it&#8217;s best to keep them below 15-20 lines of code. The difference is how properties would cascade depending on which document you&#8217;re using. Some styles may overwrite your new rules or ignore them altogether. In general it&#8217;s best to keep these two document styles separate whenever possible.</p>
<h3>Direct Page Margins</h3>
<p>There is one more technique which doesn&#8217;t appear in too many CSS resources. Using the <em>@page</em> method along with a class of selectors you can apply new printed margins on the outside of your content. I&#8217;ve included the basic code syntax below:</p>
<p><code>@page selector {<br />
    margin: 0.5in;<br />
}<br />
</code></p>
<p>The selector code is optional and can use either <em>:first</em>, <em>:left</em>, or <em>:right</em> to target the first page only, or the left/right margins on all pages respectively. In my example above we&#8217;re using the standard margin property to expand on all sides by half an inch. You could also use centimeters(cm) if the units fit your layout better.</p>
<p><a href="http://www.flickr.com/photos/keo6/6311428143/"><img src="http://designm.ag/wp-content/uploads/2011/12/united-kingdom-sunset.jpg" alt="Industrial Sunset Photography" /></a></p>
<p>If you want to check out some further reading I highly recommend <a href="http://www.webdesignerdepot.com/2010/01/10-tips-for-better-print-style-sheets/">WebDesigner Depot&#8217;s post</a> from back in 2010. It includes a lot of reference guides and great tactics for using page margins by default. These properties aren&#8217;t exactly &#8220;beginner&#8221; material, but the information is easy to pickup and with practice you&#8217;ll retain the knowledge very quickly.</p>
<h3>Conclusion</h3>
<p>Regardless of how you include the styles or what changes you makes on the page, having any type of print stylesheet is better than nothing at all. It offers your visitors an easy way of taking your content portable without the need for a mobile device. And since CSS makes it so easy the entire conversion process can be completed in an afternoon. If you have similar ideas for print-based CSS styles please share with us in the discussion area below.</p>
<br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=47843&c=909759031' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=47843&c=909759031' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></content:encoded>
			<wfw:commentRss>http://designm.ag/tutorials/how-to-properly-design-a-print-css-stylesheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>44 Photoshop Web Design Layout Tutorials</title>
		<link>http://designm.ag/tutorials/44-photoshop-web-design-layout-tutorials/</link>
		<comments>http://designm.ag/tutorials/44-photoshop-web-design-layout-tutorials/#comments</comments>
		<pubDate>Mon, 26 Dec 2011 16:10:39 +0000</pubDate>
		<dc:creator>Brant Wilson</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://designm.ag/?p=46981</guid>
		<description><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=46981&c=194584072' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=46981&c=194584072' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br />In this roundup we have collected 44 outstanding photoshop tutorials.  Enjoy these over your holiday!

<a href="http://wegraphics.net/blog/tutorials/photoshop/design-a-creative-portfolio-in-photoshop/">Design a creative portfolio in Photoshop</a>
<a href="http://wegraphics.net/blog/tutorials/photoshop/design-a-creative-portfolio-in-photoshop/"><img class="alignnone size-full wp-image-46982" src="http://designm.ag/wp-content/uploads/2011/11/1.jpg" alt="" width="500" height="683" /></a><br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=46981&c=161195062' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=46981&c=161195062' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=46981&c=987157322' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=46981&c=987157322' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>In this roundup we have collected 44 outstanding photoshop tutorials.  Enjoy these over your holiday!</p>
<p><a href="http://wegraphics.net/blog/tutorials/photoshop/design-a-creative-portfolio-in-photoshop/">Design a creative portfolio in Photoshop</a><br />
<a href="http://wegraphics.net/blog/tutorials/photoshop/design-a-creative-portfolio-in-photoshop/"><img class="alignnone size-full wp-image-46982" src="http://designm.ag/wp-content/uploads/2011/11/1.jpg" alt="" width="500" height="683" /></a></p>
<p><a href="http://www.ultimatedesignertoolkit.com/tutorials/create-colorful-business-web-layout/">How to create a colorful business web layout</a><br />
<a href="http://www.ultimatedesignertoolkit.com/tutorials/create-colorful-business-web-layout/"><img class="alignnone size-full wp-image-46983" src="http://designm.ag/wp-content/uploads/2011/11/2.jpg" alt="" width="500" height="488" /></a></p>
<p><a href="http://www.1stwebdesigner.com/tutorials/detailed-solid-dark-layout/">Create A Detailed Solid Dark Layout In Photoshop</a><br />
<a href="http://www.1stwebdesigner.com/tutorials/detailed-solid-dark-layout/"><img class="alignnone size-full wp-image-46984" src="http://designm.ag/wp-content/uploads/2011/11/3.jpg" alt="" width="500" height="542" /></a></p>
<p><a href="http://blog.szaboka.hu/tutorials/how-to-create-a-one-page-website-design-in-adobe-photoshop/">How to create a One-Page Website Design in Adobe Photoshop</a><br />
<a href="http://blog.szaboka.hu/tutorials/how-to-create-a-one-page-website-design-in-adobe-photoshop/"><img class="alignnone size-full wp-image-46985" src="http://designm.ag/wp-content/uploads/2011/11/4.jpg" alt="" width="500" height="1250" /></a></p>
<p><a href="http://webdesign.tutsplus.com/tutorials/complete-websites/design-a-drupal-business-theme-in-photoshop/">Design a Drupal Business Theme in Photoshop</a><br />
<a href="http://webdesign.tutsplus.com/tutorials/complete-websites/design-a-drupal-business-theme-in-photoshop/"><img class="alignnone size-full wp-image-46986" src="http://designm.ag/wp-content/uploads/2011/11/5.jpg" alt="" width="500" height="546" /></a></p>
<p><a href="http://webdesign.tutsplus.com/tutorials/basics-create-a-clean-magazine-blog-theme-day-1-design/">Create a Clean Magazine &amp; Blog Theme</a><br />
<a href="http://webdesign.tutsplus.com/tutorials/basics-create-a-clean-magazine-blog-theme-day-1-design/"><img class="alignnone size-full wp-image-46987" src="http://designm.ag/wp-content/uploads/2011/11/6.jpg" alt="" width="500" height="872" /></a></p>
<p><a href="http://webdesign.tutsplus.com/tutorials/complete-websites/design-and-develop-a-complete-website-a-tuts-mini-series-pt-1/">Design And Develop A Complete Website</a><br />
<a href="http://webdesign.tutsplus.com/tutorials/complete-websites/design-and-develop-a-complete-website-a-tuts-mini-series-pt-1/"><img class="alignnone size-full wp-image-46988" src="http://designm.ag/wp-content/uploads/2011/11/7.jpg" alt="" width="500" height="1060" /></a></p>
<p><a href="http://webdesign.tutsplus.com/tutorials/complete-websites/shutterpress-design-code-a-photo-portfolio-site-day-1-design/">ShutterPress: Design &amp; Code A Photo Portfolio</a><br />
<a href="http://webdesign.tutsplus.com/tutorials/complete-websites/shutterpress-design-code-a-photo-portfolio-site-day-1-design/"><img class="alignnone size-full wp-image-46989" src="http://designm.ag/wp-content/uploads/2011/11/8.jpg" alt="" width="500" height="379" /></a></p>
<p><a href="http://webdesign.tutsplus.com/tutorials/complete-websites/design-a-sleek-dark-mobile-app-website/">Design a Sleek, Dark Mobile App Website </a><br />
<a href="http://webdesign.tutsplus.com/tutorials/complete-websites/design-a-sleek-dark-mobile-app-website/"><img class="alignnone size-full wp-image-46990" src="http://designm.ag/wp-content/uploads/2011/11/9.jpg" alt="" width="500" height="498" /></a></p>
<p><a href="http://webdesign.tutsplus.com/tutorials/create-a-sleek-corporate-web-design-part-13/">Create a Sleek, Corporate Web Design</a><br />
<a href="http://webdesign.tutsplus.com/tutorials/create-a-sleek-corporate-web-design-part-13/"><img class="alignnone size-full wp-image-46991" src="http://designm.ag/wp-content/uploads/2011/11/10.jpg" alt="" width="500" height="742" /></a></p>
<p><a href="http://webdesign.tutsplus.com/tutorials/complete-websites/design-a-fresh-web-service-saas-website-interface-plus-a-free-psd/">Design a Fresh Web Service / SaaS Website Interface</a><br />
<a href="http://webdesign.tutsplus.com/tutorials/complete-websites/design-a-fresh-web-service-saas-website-interface-plus-a-free-psd/"> </a><a href="http://webdesign.tutsplus.com/tutorials/complete-websites/design-a-fresh-web-service-saas-website-interface-plus-a-free-psd/"><img class="alignnone size-full wp-image-46992" src="http://designm.ag/wp-content/uploads/2011/11/11.jpg" alt="" width="500" height="574" /></a></p>
<p><a href="http://www.photoshop-plus.co.uk/2011/08/17/learn-how-to-create-a-mobile-apps-style-layout/">Learn How To Create A Mobile App’s Style Layout</a><br />
<a href="http://www.photoshop-plus.co.uk/2011/08/17/learn-how-to-create-a-mobile-apps-style-layout/"><img class="alignnone size-full wp-image-46993" src="http://designm.ag/wp-content/uploads/2011/11/12.jpg" alt="" width="500" height="479" /></a></p>
<p><a href="http://www.photoshop-plus.co.uk/2011/07/27/corporate-portfolio-style-wordpress-layout/">Corporate &amp; Portfolio Style WordPress Layout</a><br />
<a href="http://www.photoshop-plus.co.uk/2011/07/27/corporate-portfolio-style-wordpress-layout/"><img class="alignnone size-full wp-image-46994" src="http://designm.ag/wp-content/uploads/2011/11/13.jpg" alt="" width="500" height="559" /></a></p>
<p><a href="http://www.photoshop-plus.co.uk/2011/06/07/learn-to-create-a-gaming-layout-in-photoshop/">Learn To Create A Gaming Layout In Photoshop</a><br />
<a href="http://www.photoshop-plus.co.uk/2011/06/07/learn-to-create-a-gaming-layout-in-photoshop/"><img class="alignnone size-full wp-image-46995" src="http://designm.ag/wp-content/uploads/2011/11/14.jpg" alt="" width="500" height="556" /></a></p>
<p><a href="http://line25.com/tutorials/how-to-create-a-blog-theme-concept-in-photoshop">How To Create a Blog Theme Concept in Photoshop</a><br />
<a href="http://line25.com/tutorials/how-to-create-a-blog-theme-concept-in-photoshop"><img class="alignnone size-full wp-image-46996" src="http://designm.ag/wp-content/uploads/2011/11/15.jpg" alt="" width="500" height="416" /></a></p>
<p><a href="http://www.photoshop-plus.co.uk/2011/01/03/sleek-portfolio-layout/">Sleek Portfolio Layout</a><br />
<a href="http://www.photoshop-plus.co.uk/2011/01/03/sleek-portfolio-layout/"><img class="alignnone size-full wp-image-46997" src="http://designm.ag/wp-content/uploads/2011/11/16.jpg" alt="" width="500" height="324" /></a></p>
<p><a href="http://www.photoshop-plus.co.uk/2011/05/31/learn-to-create-a-clean-style-portfolio-layout/">Learn To Create A Clean Style Portfolio Layout</a><br />
<a href="http://www.photoshop-plus.co.uk/2011/05/31/learn-to-create-a-clean-style-portfolio-layout/"><img class="alignnone size-full wp-image-46998" src="http://designm.ag/wp-content/uploads/2011/11/17.jpg" alt="" width="500" height="518" /></a></p>
<p><a href="http://designinstruct.com/web-design/create-a-modern-lab-theme-web-design-in-photoshop/">Create a Modern Lab Theme Web Design in Photoshop</a><br />
<a href="http://designinstruct.com/web-design/create-a-modern-lab-theme-web-design-in-photoshop/"><img class="alignnone size-full wp image-46999" src="http://designm.ag/wp-content/uploads/2011/11/18.jpg" alt="" width="500" height="678" /></a></p>
<p><a href="http://bloomwebdesign.net/myblog/2011/07/27/design-a-grungy-newspaper-web-layout-in-photoshop/">Design a Grungy Newspaper Web Layout in Photoshop</a><br />
<a href="http://bloomwebdesign.net/myblog/2011/07/27/design-a-grungy-newspaper-web-layout-in-photoshop/"><img class="alignnone size-full wp-image-47000" src="http://designm.ag/wp-content/uploads/2011/11/19.jpg" alt="" width="500" height="585" /></a></p>
<p><a href="http://www.designzzz.com/how-to-create-furniture-website-gallery-layout-photoshop/">Creating a Clean Furniture Website and Gallery Layout in Photoshop</a><br />
<a href="http://www.designzzz.com/how-to-create-furniture-website-gallery-layout-photoshop/"><img class="alignnone size-full wp-image-47001" src="http://designm.ag/wp-content/uploads/2011/11/20.jpg" alt="" width="500" height="425" /></a></p>
<p><a href="http://www.1stwebdesigner.com/tutorials/gaming-layout-photoshop/">GD-Gaming: Create a Simple Gaming Layout in Photoshop</a><br />
<a href="http://www.1stwebdesigner.com/tutorials/gaming-layout-photoshop/"><img class="alignnone size-full wp-image-47002" src="http://designm.ag/wp-content/uploads/2011/11/21.jpg" alt="" width="500" height="666" /></a></p>
<p><a href="http://webdesign.tutsplus.com/tutorials/complete-websites/create-a-dark-clean-website-design-in-adobe-photoshop-free-psd/">Create A Dark, Clean Website Design In Adobe Photoshop</a><br />
<a href="http://webdesign.tutsplus.com/tutorials/complete-websites/create-a-dark-clean-website-design-in-adobe-photoshop-free-psd/"><img class="alignnone size-full wp-image-47003" src="http://designm.ag/wp-content/uploads/2011/11/22.jpg" alt="" width="500" height="501" /></a></p>
<p><a href="http://webdesign.tutsplus.com/tutorials/complete-websites/create-a-comic-book-themed-web-design-photoshop-to-html-css-part-1/">Create a Comic Book Themed Web Design</a><br />
<a href="http://webdesign.tutsplus.com/tutorials/complete-websites/create-a-comic-book-themed-web-design-photoshop-to-html-css-part-1/"><img class="alignnone size-full wp-image-47004" src="http://designm.ag/wp-content/uploads/2011/11/23.jpg" alt="" width="500" height="651" /></a></p>
<p><a href="http://webdesign.tutsplus.com/tutorials/complete-websites/design-an-innovative-portfolio-site-using-alternative-uiux/">Design An Innovative Portfolio Site Using Alternative UI/UX</a><br />
<a href="http://webdesign.tutsplus.com/tutorials/complete-websites/design-an-innovative-portfolio-site-using-alternative-uiux/"><img class="alignnone size-full wp-image-47005" src="http://designm.ag/wp-content/uploads/2011/11/24.jpg" alt="" width="500" height="340" /></a></p>
<p><a href="http://webdesign.tutsplus.com/tutorials/complete-websites/create-a-wickedly-cool-horizontally-oriented-website-design/">Create A Wickedly Cool Horizontally Oriented Website Design</a><br />
<a href="http://webdesign.tutsplus.com/tutorials/complete-websites/create-a-wickedly-cool-horizontally-oriented-website-design/"><img class="alignnone size-full wp-image-47006" src="http://designm.ag/wp-content/uploads/2011/11/25.jpg" alt="" width="500" height="309" /></a></p>
<p><a href="http://webdesign.tutsplus.com/tutorials/complete-websites/create-a-clean-and-minimal-portfolio-design-plus-a-free-psd/">Create a Clean and Minimal Portfolio Design </a><br />
<a href="http://webdesign.tutsplus.com/tutorials/complete-websites/create-a-clean-and-minimal-portfolio-design-plus-a-free-psd/"><img class="alignnone size-full wp-image-47007" src="http://designm.ag/wp-content/uploads/2011/11/26.jpg" alt="" width="500" height="599" /></a></p>
<p><a href="http://webdesign.tutsplus.com/tutorials/complete-websites/create-an-illustrative-single-page-web-design-with-photoshop/">Create an Illustrative Single Page Web Design With Photoshop</a><br />
<a href="http://webdesign.tutsplus.com/tutorials/complete-websites/create-an-illustrative-single-page-web-design-with-photoshop/"><img class="alignnone size-full wp-image-47008" src="http://designm.ag/wp-content/uploads/2011/11/27.jpg" alt="" width="500" height="1059" /></a></p>
<p><a href="http://webdesign.tutsplus.com/tutorials/complete-websites/design-a-professional-clean-community-blog-theme-in-adobe-photoshop/">Design a Professional, Clean Community Blog Theme in Adobe Photoshop</a><br />
<a href="http://webdesign.tutsplus.com/tutorials/complete-websites/design-a-professional-clean-community-blog-theme-in-adobe-photoshop/"><img class="alignnone size-full wp-image-47009" src="http://designm.ag/wp-content/uploads/2011/11/28.jpg" alt="" width="500" height="1786" /></a></p>
<p><a href="http://webdesign.tutsplus.com/tutorials/coffeeaddict-an-illustrative-wood-design-free-psd-and-html/">The Making of CoffeeAddict: An Illustrative Wood Design </a><br />
<a href="http://webdesign.tutsplus.com/tutorials/coffeeaddict-an-illustrative-wood-design-free-psd-and-html/"><img class="alignnone size-full wp-image-47010" src="http://designm.ag/wp-content/uploads/2011/11/29.jpg" alt="" width="500" height="449" /></a></p>
<p><a href="http://www.1stwebdesigner.com/tutorials/myriad-pro-minimal-wordpress-theme/">Create a Minimal WordPress Theme in Photoshop</a><br />
<a href="http://www.1stwebdesigner.com/tutorials/myriad-pro-minimal-wordpress-theme/"><img class="alignnone size-full wp-image-47011" src="http://designm.ag/wp-content/uploads/2011/11/30.jpg" alt="" width="500" height="771" /></a></p>
<p><a href="http://www.1stwebdesigner.com/tutorials/dark-wordpress-layout-photoshop/">Learn How To Create Modern Dark WordPress Layout In Photoshop</a><br />
<a href="http://www.1stwebdesigner.com/tutorials/dark-wordpress-layout-photoshop/"><img class="alignnone size-full wp-image-47012" src="http://designm.ag/wp-content/uploads/2011/11/31.jpg" alt="" width="500" height="874" /></a></p>
<p><a href="http://www.blog.spoongraphics.co.uk/tutorials/how-to-create-a-sleek-grid-based-website-design">How To Create a Sleek Grid Based Website Design</a><br />
<a href="http://www.blog.spoongraphics.co.uk/tutorials/how-to-create-a-sleek-grid-based-website-design"><img class="alignnone size-full wp-image-47013" src="http://designm.ag/wp-content/uploads/2011/11/32.jpg" alt="" width="500" height="403" /></a></p>
<p><a href="http://psd-files.com/blog/how-to-create-a-vintage-photoshop-file/">How to create a vintage Photoshop file</a><br />
<a href="http://psd-files.com/blog/how-to-create-a-vintage-photoshop-file/"><img class="alignnone size-full wp-image-47014" src="http://designm.ag/wp-content/uploads/2011/11/33.jpg" alt="" width="500" height="715" /></a></p>
<p><a href="http://designinstruct.com/web-design/create-an-elegant-patterned-web-design-in-photoshop/">Create an Elegant Patterned Web Design in Photoshop</a><br />
<a href="http://designinstruct.com/web-design/create-an-elegant-patterned-web-design-in-photoshop/"><img class="alignnone size-full wp-image-47015" src="http://designm.ag/wp-content/uploads/2011/11/34.jpg" alt="" width="500" height="475" /></a></p>
<p><a href="http://www.visualswirl.com/tutorials/create-clean-minimal-web-design-photoshop/">Create a Clean, Minimal Website Design in Photoshop</a><br />
<a href="http://www.visualswirl.com/tutorials/create-clean-minimal-web-design-photoshop/"><img class="alignnone size-full wp-image-47016" src="http://designm.ag/wp-content/uploads/2011/11/35.jpg" alt="" width="500" height="500" /></a></p>
<p><a href="http://psd.fanextra.com/tutorials/design-a-cool-pixelated-website-layout/">Design a Cool Pixelated Website Layout</a><br />
<a href="http://psd.fanextra.com/tutorials/design-a-cool-pixelated-website-layout/"><img class="alignnone size-full wp-image-47017" src="http://designm.ag/wp-content/uploads/2011/11/36.jpg" alt="" width="500" height="500" /></a></p>
<p><a href="http://designinstruct.com/web-design/create-a-light-textured-web-design-in-photoshop/">Create a Light Textured Web Design in Photoshop</a><br />
<a href="http://designinstruct.com/web-design/create-a-light-textured-web-design-in-photoshop/"><img class="alignnone size-full wp-image-47018" src="http://designm.ag/wp-content/uploads/2011/11/37.jpg" alt="" width="500" height="791" /></a></p>
<p><a href="http://psd.fanextra.com/tutorials/design-a-clean-corporate-website-layout/">Design a Clean Corporate Website Layout</a><br />
<a href="http://psd.fanextra.com/tutorials/design-a-clean-corporate-website-layout/"><img class="alignnone size-full wp-image-47019" src="http://designm.ag/wp-content/uploads/2011/11/38.jpg" alt="" width="500" height="500" /></a></p>
<p><a href="http://psd.fanextra.com/tutorials/create-a-professional-app-store-web-layout/">Create a Professional App Store Web Layout</a><br />
<a href="http://psd.fanextra.com/tutorials/create-a-professional-app-store-web-layout/"><img class="alignnone size-full wp-image-47020" src="http://designm.ag/wp-content/uploads/2011/11/39.jpg" alt="" width="500" height="590" /></a></p>
<p><a href="http://www.1stwebdesigner.com/tutorials/burnstudio-tutorial-personal-website/">Create An Amazing Personal Website From Scratch Using Photoshop</a><br />
<a href="http://www.1stwebdesigner.com/tutorials/burnstudio-tutorial-personal-website/"><img class="alignnone size-full wp-image-47021" src="http://designm.ag/wp-content/uploads/2011/11/40.jpg" alt="" width="500" height="625" /></a></p>
<p><a href="http://www.photoshop-plus.co.uk/2010/11/16/learn-how-to-create-a-web-gallery-style-layout/">Learn How To Create A Web Gallery Style Layout</a><br />
<a href="http://www.photoshop-plus.co.uk/2010/11/16/learn-how-to-create-a-web-gallery-style-layout/"><img class="alignnone size-full wp-image-47022" src="http://designm.ag/wp-content/uploads/2011/11/41.jpg" alt="" width="500" height="398" /></a></p>
<p><a href="http://photoshoptutorials.ws/photoshop-tutorials/layouts/how-to-create-a-professional-web-layout-in-photoshop.html">How to Create a Professional Web Layout in Photoshop</a><br />
<a href="http://photoshoptutorials.ws/photoshop-tutorials/layouts/how-to-create-a-professional-web-layout-in-photoshop.html"><img class="alignnone size-full wp-image-47023" src="http://designm.ag/wp-content/uploads/2011/11/42.jpg" alt="" width="500" height="625" /></a></p>
<p><a href="http://line25.com/tutorials/design-a-textured-outdoors-website-in-photoshop">Design a Textured Outdoors Website in Photoshop</a><br />
<a href="http://line25.com/tutorials/design-a-textured-outdoors-website-in-photoshop"><img class="alignnone size-full wp-image-47024" src="http://designm.ag/wp-content/uploads/2011/11/43.jpg" alt="" width="500" height="426" /></a><br />
<a href="http://webdesignfan.com/create-a-portfolio-web-layout-in-photoshop/">Create a Portfolio Web Layout in Photoshop</a></p>
<p><a href="http://webdesignfan.com/create-a-portfolio-web-layout-in-photoshop/"><img class="alignnone size-full wp-image-47025" src="http://designm.ag/wp-content/uploads/2011/11/44.jpg" alt="" width="500" height="1016" /></a></p>
<br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=46981&c=1252216560' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=46981&c=1252216560' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></content:encoded>
			<wfw:commentRss>http://designm.ag/tutorials/44-photoshop-web-design-layout-tutorials/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Animate a Custom Dialog Box with CSS3 and jQuery</title>
		<link>http://designm.ag/tutorials/animate-a-custom-dialog-box-with-css3-and-jquery/</link>
		<comments>http://designm.ag/tutorials/animate-a-custom-dialog-box-with-css3-and-jquery/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 16:36:56 +0000</pubDate>
		<dc:creator>Jake Rocheleau</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://designm.ag/?p=47372</guid>
		<description><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=47372&c=807490312' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=47372&c=807490312' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>I am a particular fan of the jQuery UI library and have been following the team since it's release. It features dozens of examples of how to pull together the best animations from such a small library of code. However in a lot of websites these days we are seeking to limit dynamic JavaScript blocks. As such CSS3 has become an important staple with building dialog boxes.</p>

<p>In this short tutorial I'd like to go over the process of building a simple fade-in dialog box. This may contain a signup/login form, input buttons, or even just a message to your visitors. The technique is pristine and gaining adoption in the sphere of web developers everywhere.</p>

<p><a href="http://designm.ag/previews/jquery-dialog-box/"><img src="http://designm.ag/wp-content/uploads/2011/12/jquery-animated-dialog-box.jpg" alt="featured image demo screenshot - jQuery dialog box" class="imgborder" /></a></p><br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=47372&c=408714664' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=47372&c=408714664' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=47372&c=2135676806' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=47372&c=2135676806' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>I am a particular fan of the jQuery UI library and have been following the team since it&#8217;s release. It features dozens of examples of how to pull together the best animations from such a small library of code. However in a lot of websites these days we are seeking to limit dynamic JavaScript blocks. As such CSS3 has become an important staple with building dialog boxes.</p>
<p>In this short tutorial I&#8217;d like to go over the process of building a simple fade-in dialog box. This may contain a signup/login form, input buttons, or even just a message to your visitors. The technique is pristine and gaining adoption in the sphere of web developers everywhere.</p>
<p><a href="http://designm.ag/previews/jquery-dialog-box/"><img src="http://designm.ag/wp-content/uploads/2011/12/jquery-animated-dialog-box.jpg" alt="featured image demo screenshot - jQuery dialog box" class="imgborder" /></a></p>
<p><span id="more-47372"></span></p>
<p style="text-align:center"><strong><a href="http://designm.ag/previews/jquery-dialog-box/">Live Demo</a></strong> &#8211; <strong><a href="http://designm.ag/downloads/jquery-dialog-box-source.zip">Download</a></strong></p>
<h3>Setting the Stage</h3>
<p>Your first step is to hit <a href="http://jquery.com/">the jQuery website</a> and check on their latest version. As of this writing it&#8217;s 1.7.1 stable release. If you wish to include animated effects from the <a href="http://jqueryui.com/">jQuery UI library</a> you may include this script as well. But your functional code will become much more convoluted with this extra pressure.</p>
<p>Now to save time let&#8217;s work off a bit of code from an <a href="http://yensdesign.com/2008/09/how-to-create-a-stunning-and-smooth-popup-using-jquery/">earlier tutorial</a> published in 2008. yens design has a fantastic bit of code written in jQuery which behaves as a popup box. To get a hold of their demo just <a href="http://yensdesign.com/tutorials/popupjquery/popupjquery.rar">download the rar package</a> which includes the popup.js file.</p>
<h3>Building our first HTML</h3>
<p>Since the earlier tutorial was written a few years ago I feel we should work with only the important, up-to-date code bits. Thus I&#8217;ve created a brand new HTML document <strong>index.html</strong> and included my basic HTML5 boilerplate template.</p>
<p>This includes the doctype declaration and our starting scripts. The stylesheet <strong>style.css</strong> will include both the properties for our popup and for some of the new page edits. Check out my beginner&#8217;s template code below.</p>
<p>[cc lang="css"]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html lang=&quot;en&quot;&gt;<br />
&lt;head&gt;<br />
	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;<br />
	&lt;title&gt;jQuery UI Dialog Box with Animation&lt;/title&gt;<br />
	&lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;<br />
	&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;<br />
	&lt;script type=&quot;text/javascript&quot; src=&quot;popup.js&quot;&gt;&lt;/script&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/cc]</p>
<p>Both the jQuery standard and UI libraries can be pulled directly from Google&#8217;s CDN. It has never been down for me, and I always rely on their hosted code for project files. Now that we have a page template setup I&#8217;d like to introduce a bit of the body content. I&#8217;ve included just this portion again for ease of access.</p>
<h3>Inside the Popup</h3>
<p>[cc lang="html]</p>
<div>
<h2><button>click for dialog box!</button></h2>
<p>Built around CSS3 styles for added effect&#8230;</p>
<p>And works in all jQuery-supported browsers!</p>
<div>
		<a id="popupClose">x</a></p>
<h1>Important message text!</h1>
<p>You may close this at any point by clicking off the window, or by using the top right corner &#8216;X&#8217; button. jQuery is very forgiving in this regard <img src='http://designm.ag/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
</p></div>
<div></div>
</div>
<p>[/cc]</p>
<p>Inside the wrap div we&#8217;ve got all our main elements from within the tutorial. The <strong>displaypopup</strong> button could theoretically hold any item &#8211; anchor link, heading text, or even a replacement image. Ultimately jQuery is looking for the ID &#8220;displaypopup&#8221; to match and trigger a bind-click event handler.</p>
<p>All the content inside <strong>myPopup</strong> will be displayed within this new box. Inside our CSS rules we also set the default height, width, background, and similar properties of this box. Outside the <strong>backgroundPopup</strong> is used to differentiate between these 2 areas. If you noticed, our script will actually close down the window if you click anywhere else in the background! Pretty neat effect and very influential towards user experience.</p>
<p>So now let&#8217;s jump over and take a quick peek at some of our CSS styles. A lot has been kept similar to Adrian&#8217;s code in his previous tutorial. Yet we are using a bit of flair around the box to appear more animated.</p>
<h3>Styling with CSS</h3>
<p>First check out the page structure I&#8217;ve used for each core element. The Asterisk (*) selector is handy as an overall reset to browser defaults. Thus we remove all generic margins, padding, and inherit the default line-height appropriate to each font style.</p>
<p>[cc lang="css]* {<br />
	margin: 0;<br />
	padding: 0;<br />
	line-height: inherit;<br />
}<br />
body {<br />
background: #fff;<br />
line-height: 1;<br />
font-size: 12px;<br />
font-family: Arial, Tahoma, sans-serif;<br />
margin: 0;<br />
height: 100%;<br />
}</p>
<p>#wrap {<br />
width: 600px;<br />
background: #ddeef8;<br />
margin: 0 auto;<br />
margin-top: 55px;<br />
padding: 14px 19px;<br />
}<br />
[/cc]</p>
<p>Also pick up how the body selector uses <strong>height: 101%;</strong> so the page loads by default displaying a scrollbar. This is important because even if your page content isn&#8217;t long enough to create one, a scrollbar will appear in some instances when your popup first opens. This bug has mostly been reserved to IE and Safari but it fixes other possible issues as well.</p>
<p>[cc lang="css"]#backgroundPopup{<br />
display: none;<br />
position: fixed;<br />
height: 100%;<br />
width: 100%;<br />
top: 0;<br />
left: 0;<br />
background: #000;<br />
border: 1px solid #cecece;<br />
z-index: 1;<br />
}</p>
<p>#myPopup {<br />
display: none;<br />
position: fixed;<br />
height: 300px;<br />
width: 408px;<br />
background: #fbfbfb;<br />
border: 2px solid #cecece;<br />
z-index: 2;<br />
padding: 14px;<br />
font-size: 14px;<br />
border-radius: 5px;<br />
-moz-border-radius: 5px;<br />
-webkit-border-radius: 5px;<br />
}<br />
#myPopup h1{<br />
text-align: left;<br />
color: #6fa5fd;<br />
font-size: 22px;<br />
line-height: 28px;<br />
font-weight: bold;<br />
border-bottom: 1px dotted #D3D3D3;<br />
padding-bottom: 2px;<br />
margin-bottom: 20px;<br />
}</p>
<p>#popupClose{<br />
font-size: 16px;<br />
line-height: 14px;<br />
right: 6px;<br />
top: 4px;<br />
position: absolute;<br />
color: #6fa5fd;<br />
font-weight: bold;<br />
display: block;<br />
}<br />
[/cc]</p>
<p>Now we have some of the juicier details pertaining with CSS3 properties out of the way. The <strong>backgroundPopup</strong> has an important role set to a black background color. Notice that we actually reduce the opacity with jQuery instead of CSS3, that way we&#8217;ve got more control over the animation. However I am noticing designers picking up <a href="http://css3.bradshawenterprises.com/">CSS3 transitions</a> which may eventually overtake this technique.</p>
<p>Inside the <strong>myPopup</strong> content box is all the heading text/closing link shown earlier. Additionally I&#8217;ve increased the border size to stand out as more significant in comparison with the deep background. Some real simple rounded corners in CSS3 makes the dialog feel less rigid than standard square corners.</p>
<h3>Digging the jQuery Functions</h3>
<p>If you&#8217;ve looked into the popup.js file at all you should notice a couple of things. Namely Adrian(the original developer) has created numerous functions which will save us time in the long run. With a few variables you can actually control the speed of the animation and how long the fade-in effect will take.</p>
<p>[cc lang="javascript"]function loadPopup(){<br />
	if(popupStatus==0){<br />
		$(&#8220;#backgroundPopup&#8221;).css({<br />
			&#8220;opacity&#8221;: &#8220;0.7&#8243;<br />
		});<br />
		$(&#8220;#backgroundPopup&#8221;).fadeIn(&#8220;slow&#8221;);<br />
		$(&#8220;#myPopup&#8221;).fadeIn(&#8220;slow&#8221;);<br />
		popupStatus = 1;<br />
	}<br />
}</p>
<p>function disablePopup(){<br />
	if(popupStatus==1){<br />
		$(&#8220;#backgroundPopup&#8221;).fadeOut(&#8220;slow&#8221;);<br />
		$(&#8220;#myPopup&#8221;).fadeOut(&#8220;slow&#8221;);<br />
		popupStatus = 0;<br />
	}<br />
}<br />
[/cc]</p>
<p>These two bits of code above are your action commands. <strong>loadPopup</strong> is the generic function call required to open a new popup window, while <strong>disablePopup</strong> will do just the opposite and close a currently opened window. Since these are written as functions within the scope of this tutorial we&#8217;ve targeted each specific ID name. But you can create a more versatile setup with variable parameters hard-coded into each function call.</p>
<p>We have a bit more code afterwards which helps to grab the browser height/width and adjust the window centered on the screen. But the final function calls a <em>document.ready()</em> clause which opens directly on page load. Check out my example edits from Adrian&#8217;s original code below:</p>
<p>[cc lang="javascript"]$(document).ready(function(){<br />
	$(&#8220;#displaypopup&#8221;).click(function(){<br />
		centerPopup();<br />
		loadPopup();<br />
	});</p>
<p>	$(&#8220;#popupClose&#8221;).click(function(){<br />
		disablePopup();<br />
	});<br />
	$(&#8220;#backgroundPopup&#8221;).click(function(){<br />
		disablePopup(); // clicked on the background<br />
	});<br />
	$(document).keypress(function(e){<br />
		if(e.keyCode==27 &amp;&amp; popupStatus==1){<br />
			disablePopup();<br />
                        // pressed the esc key<br />
		}<br />
	});<br />
});<br />
[/cc]</p>
<p>We attribute a few click event handlers which each call a different function. If the user clicks anywhere outside of the window, presses the ESC key or clicks the small &#8220;x&#8221; link then the window will fade out to close. This also resets the <strong>popupStatus</strong> variable to 0, which you may call upon at any point during the script to check if the user can see the window or not.</p>
<p style="text-align:center"><strong><a href="http://designm.ag/previews/jquery-dialog-box/">Live Demo</a></strong> &#8211; <strong><a href="http://designm.ag/downloads/jquery-dialog-box-source.zip">Download</a></strong></p>
<h3>Conclusion</h3>
<p>I want to give a big thanks to <a href="http://cokidoo.com/">Adrian Mato Gondelle</a> who originally setup such a fantastic demo. I&#8217;ve incorporated his script in here as both a means to save time and stress messing with new jQuery functions. The code is open enough where you can pick apart each feature and re-implement it in an entirely different aspect, so why re-invent the wheel? And with so much browser support you can expect much more positive feedback from your visitors.</p>
<br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=47372&c=1751261344' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=47372&c=1751261344' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></content:encoded>
			<wfw:commentRss>http://designm.ag/tutorials/animate-a-custom-dialog-box-with-css3-and-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Case Study: Building an &#8216;About the Author&#8217; Box in WordPress 3.2</title>
		<link>http://designm.ag/tutorials/case-study-building-an-about-the-author-box-in-wordpress-3-2/</link>
		<comments>http://designm.ag/tutorials/case-study-building-an-about-the-author-box-in-wordpress-3-2/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 15:04:28 +0000</pubDate>
		<dc:creator>Jake Rocheleau</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://designm.ag/?p=46739</guid>
		<description><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=46739&c=989210704' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=46739&c=989210704' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>I'm sure those of you familiar with Wordpress blogs have seen the many author box designs. Most of the popular web design and social media magazines feature some type of author display box towards the bottom of each post. This features the author name, avatar, and generally a short bio along with profile links.</p>

<p>Wordpress users who are up to date with the latest 3.2.x release can easily implement this feature via <a href="http://wordpress.org/extend/plugins/search.php?q=author+box">custom plugins</a> to extend WP functionality. But I want to explain how you can custom-code your own author box! I feel this method gives you more control over the layout and you can manipulate the HTML/CSS much further than with plugin codes.</p><br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=46739&c=1652864483' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=46739&c=1652864483' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=46739&c=495673085' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=46739&c=495673085' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>I&#8217;m sure those of you familiar with WordPress blogs have seen the many author box designs. Most of the popular web design and social media magazines feature some type of author display box towards the bottom of each post. This features the author name, avatar, and generally a short bio along with profile links.</p>
<p>WordPress users who are up to date with the latest 3.2.x release can easily implement this feature via <a href="http://wordpress.org/extend/plugins/search.php?q=author+box">custom plugins</a> to extend WP functionality. But I want to explain how you can custom-code your own author box! I feel this method gives you more control over the layout and you can manipulate the HTML/CSS much further than with plugin codes.</p>
<p><span id="more-46739"></span></p>
<h3>The Case Study Details</h3>
<p>For this particular tutorial I&#8217;ll be referencing the work done on DesignMag&#8217;s template. If you check out the bottom of each post you should notice a new author box design implemented just towards the last week in October.</p>
<p>I have included the author name and avatar along with some generic WordPress functions. Using some WP easter eggs I also created a smaller label which tallies the total articles each author has written and links to their personal author page. I advise using something similar to this if only to give each author some more spotlight in search engines.</p>
<p>There are also some other additions we could include, such as a custom Facebook or Twitter URL outside of the bio. But without overly-complicating things let&#8217;s focus on building a similar product as seen in our webpage design.</p>
<h3>Static HTML Code</h3>
<p>To start off let&#8217;s focus solely on building the framework for our author box. If it helps save an HTML template of a single blog post from your website to work with, like a development sandbox. In this way you don&#8217;t need to mess around with the WordPress theme files(yet) and no need to worry about PHP code, either.</p>
<p>[cc lang="html"]<!-- @begin author box --></p>
<div>
<div class="silkwrapper clearfix">
<section>
	    <img src="img/avatar.jpg" alt="author avatar pic" /><br />
	</section>
<p>[/cc]</p>
<p>Since the HTML block is rather small I&#8217;ve broken it into 2 segments. Hopefully in this way it&#8217;ll be easier to explain each part. In the above portion the ID <em>#post-author-box</em> is used as an overall wrapper to add an outer border effect onto the whole box itself. I&#8217;m also going to use some padding so the internal elements are spaced away from the edge border.</p>
<p>The inner div only contains two(2) classes <strong>silkwrapper</strong> and <strong>clearfix</strong>. The silkwrapper is mainly a covering class to style and contain all internal content. Since the layout is split into 2 columns I also included a clearfix so the float behavior doesn&#8217;t bug out in older browsers. Now inside of this div I&#8217;m using two <a href="http://www.impressivewebs.com/html5-section/">HTML5 section</a> elements for the left and right area, respectively.</p>
<p>[cc lang="html"]<br />
<section>
<h2>Author: <span>Authors Name</span></h2>
<h3>Articles: Total of <a href="#">999  posts</a></h3>
<p>Real simple basic information here. Pull directly from the WordPress backend.</p>
</section>
</div>
</div>
<p><!-- @end author box --><br />
[/cc]</p>
<p><em>#post-author-image</em> is the ID set to our first section. This floats to the left side and houses only our author avatar image. WordPress directly ties into <a href="http://gravatar.com/">Gravatar</a> so your authors may not even need to edit their image by default. Alternatively <em>#post-author-box-content</em> also floats left but each section is given a specific width to limit run-off from the inner content.</p>
<h3>Styles and CSS Properties</h3>
<p>We actually don&#8217;t need to apply a whole lot of CSS rules here. Most of them you should be familiar with but I&#8217;ll cover any new or possibly confusing areas in the code.</p>
<p>[cc lang="css"]#post-author-box { display: block; padding: 4px; margin-top: 15px; border: 1px solid #e0dfde; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -o-border-radius: 3px; margin-bottom: 35px; }<br />
#post-author-box .silkwrapper { background: #eeeeee; padding: 9px 11px; }<br />
[/cc]</p>
<p>The <em>#post-author-box</em> uses CSS3 border radius properties for rounded corners within the external border. I&#8217;m using all the standard properties for -webkit, -moz(Mozilla), -o(Opera), -ms(Internet Explorer 9+) and the regular border-radius. The silkwrapper class has a slightly darker background to stand out among the plain white page content.</p>
<p>[cc lang="css"]#post-author-box-content { display: block; float: left; height: auto;  position: relative; width: 440px; padding-top: 9px; }<br />
#post-author-box-content h2 { display: block; font: 1.4em/1.0em bold &#8220;Trebuchet MS&#8221;, Arial, sans-serif; color: #4d4d4d; text-shadow: 0px 1px 1px #fff; margin: 0 !important; padding-bottom: 8px; }<br />
#post-author-box-content h2 span { color: #275081; }<br />
[/cc]</p>
<p>The box content includes an H2 and H3 element for the author name and total posts listing. I am using another CSS3 property <strong>text-shadow</strong> to add a unique effect into the top content, similar to Apple&#8217;s chrome letter styles. The author&#8217;s name is wrapped in a <em>&lt;span&gt;</em> tag which gives this text a particular shade of dark blue, jumping out from the rest of our content.</p>
<h3>Designing the Avatar Image</h3>
<p>This last bit of CSS isn&#8217;t particularly confusing, although it can be frustrating when you go to implement this code into WordPress. The PHP functions required to pull avatar images do not let you add another class or ID into the element. This means you cannot target the image directly without housing it inside another wrapper. Check out my styles below:</p>
<p>[cc lang="css"]#post-author-image { display: block; float: left; width: 155px; }<br />
#post-author-image img { background: #f3f3f3; padding: 3px; border: 4px solid #dddbd7; }<br />
[/cc]</p>
<p>The <em>#post-author-image</em> section is limited at 155px in width. Gravatar maxes out at 256&#215;256 height and width for any image. We&#8217;ll be pulling the avatar at exactly half these dimensions (128&#215;128) so 155px leaves breathing room between the right content area.</p>
<p>Also I&#8217;m using both a background with padding and a border for a fancier display. The padding is 3px all the way around so our background appears to come out 3 pixels on each side. The border is 4 pixels wide which also expands evenly on each side. This will add about 15px to the width, but 155px total should still hold everything. If not you can always re-size the avatar or increase the <em>#post-author-image</em> section to 160px or 170px.</p>
<h3>Applying Code to WordPress</h3>
<p>If the example styles are still confusing just check out <a href="http://designm.ag/wp-content/themes/dmv4.5_white/style.css">our stylesheet</a> to see the full code details. Additionally you are not required to duplicate your box exactly as we have done here on DesignMag. Use your designer&#8217;s judgement and include styles which match your own blog theme the best.</p>
<p>Now that everything is coded and styled we should replace the default HTML content with WordPress PHP functionality. To save space I included the whole code block below with replacement PHP snippets. Inside the current theme directory I made a new <strong>authorbox.php</strong> file which will contain just this code bit, which we can then include into WordPress&#8217; <strong>single.php</strong> for single blog posts.</p>
<p>[cc lang="php"]
<div>
<div class="silkwrapper clearfix">
<section>
</section>
<section>
<h2>Author: <span></span></h2>
<h3>Articles: Total of &lt;a href=&quot;/author//&#8221;&gt;  posts</a></h3>
</p>
</section>
</div>
</div>
<p>[/cc]</p>
<p>I&#8217;ll give a quick overview of each function at play here. If you understand PHP and WordPress there shouldn&#8217;t be much confusion and you can always check the <a href="http://codex.wordpress.org/">WP Codex</a> for additional info.</p>
<ul>
<li><strong>get_avatar()</strong> &#8211; Here we output a plain HTML image using the current author&#8217;s e-mail address. The second parameter defines a numeric height/width in pixels for Gravatar to return(max 256px).</li>
<li><strong>the_author_meta(&#8216;display_name&#8217;)</strong> &#8211; <a href="http://codex.wordpress.org/Function_Reference/the_author_meta">the_author_meta()</a> is a general function used within any WordPress loop. You pass in a key value and the output returned is specific to the current author metadata. In this scenario the author&#8217;s <em>display_name</em> is output which can be set from their profile page.</li>
<li><strong>the_author_meta(&#8216;user_login&#8217;)</strong> &#8211; similar to the above function except in this scenario we need to append the username to hack together an author URL. By default WordPress uses <em>/author/username/</em> for these pages so it&#8217;s rather easy to put together a custom anchor. Note that <a href="http://codex.wordpress.org/Function_Reference/get_author_posts_url">get_author_posts_url()</a> is another option, but this requires parameters which will just muck up our code even more.</li>
<li><strong>the_author_posts()</strong> &#8211; easy as pie here! We are just outputting the total number of posts this author has written and published.</li>
<li><strong>the_author_meta(&#8216;description&#8217;)</strong> &#8211; this last meta function will output a paragraph of text from the author&#8217;s bio section. This will support HTML tags such as anchor links. Author&#8217;s are generally encouraged to include their website or Twitter links here.</li>
</ul>
<h3>Completing the Process</h3>
<p>For some web server setups you may not be able to include an external PHP file because of security settings. This means even though <strong>authorbox.php</strong> is in the same directory an <em>include()</em> function may fail outright. Add the following into your single.php and check if it works or not.</p>
<pre>&lt;?php include (get_bloginfo('template_url')."/authorbox.php"); ?&gt;</pre>
<p>Assuming this works then congrats on the new setup! But if you&#8217;re getting hit back with PHP errors you may consider moving all your code from authorbox.php right into single.php. To do this select all the code from your authorbox and cut/paste into the same area in your single.php, and don&#8217;t forget to delete the <em>include()</em> call! Save &amp; reload the page and assuming your code is within the WP loop everything should work perfectly!</p>
<p>If you end up building your own custom author box style we would love to check it out! Just let us know your website URL in the discussion area, along with any cool tips you picked up during the process.</p>
<br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=46739&c=1970630556' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=46739&c=1970630556' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></content:encoded>
			<wfw:commentRss>http://designm.ag/tutorials/case-study-building-an-about-the-author-box-in-wordpress-3-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>25 Unique Adobe InDesign Tutorials for Newbies</title>
		<link>http://designm.ag/tutorials/25-unique-adobe-indesign-tutorials-for-newbies/</link>
		<comments>http://designm.ag/tutorials/25-unique-adobe-indesign-tutorials-for-newbies/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 03:45:11 +0000</pubDate>
		<dc:creator>Jake Rocheleau</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://designm.ag/?p=46384</guid>
		<description><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=46384&c=279555838' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=46384&c=279555838' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>Masters of the Adobe software suite often lean towards graphic design or web development. When creating documents for print this can easily be transcribed in both Adobe Photoshop and Illustrator. However, Adobe InDesign allows you to create entire projects such as a magazines, online e-books, cover pages, flyers, etc. But most people just haven’t had the time to learn how to utilize these features!</p>

<p>If you are feeling bold check out the showcase collection below. I put together 25 beginner-intermediate level tutorials which will get you more familiar with InDesign. Once you understand what can be accomplished it may change your entire workflow!</p>

<h3><a href="http://www.webcoursesbangkok.com/blog/business-card-design-indesign/">Business Card Design</h3>
<p><a href="http://www.webcoursesbangkok.com/blog/business-card-design-indesign/"><img src="http://designm.ag/wp-content/uploads/2011/10/01-business-card-indesign.jpg" class="imgborder" /></a></p><br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=46384&c=1236217152' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=46384&c=1236217152' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=46384&c=532631223' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=46384&c=532631223' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>Masters of the Adobe software suite often lean towards graphic design or web development. When creating documents for print this can easily be transcribed in both Adobe Photoshop and Illustrator. However, Adobe InDesign allows you to create entire projects such as a magazines, online e-books, cover pages, flyers, etc. But most people just haven’t had the time to learn how to utilize these features!</p>
<p>If you are feeling bold check out the showcase collection below. I put together 25 beginner-intermediate level tutorials which will get you more familiar with InDesign. Once you understand what can be accomplished it may change your entire workflow!</p>
<h3><a href="http://www.webcoursesbangkok.com/blog/business-card-design-indesign/">Business Card Design</h3>
<p><a href="http://www.webcoursesbangkok.com/blog/business-card-design-indesign/"><img src="http://designm.ag/wp-content/uploads/2011/10/01-business-card-indesign.jpg" class="imgborder" /></a></p>
<p><span id="more-46384"></span></p>
<h3><a href="http://tv.adobe.com/watch/learn-indesign-cs4/getting-started-01-starting-a-new-document/">Starting a New Document</h3>
<p><a href="http://tv.adobe.com/watch/learn-indesign-cs4/getting-started-01-starting-a-new-document/"><img src="http://designm.ag/wp-content/uploads/2011/10/02-indesign-newdoc.jpg" class="imgborder" /></a></p>
<h3><a href="http://tv.adobe.com/watch/learn-indesign-cs4/getting-started-07-placing-an-image/">Placing an Image</h3>
<p><a href="http://tv.adobe.com/watch/learn-indesign-cs4/getting-started-07-placing-an-image/"><img src="http://designm.ag/wp-content/uploads/2011/10/03-placing-images.jpg" class="imgborder" /></a></p>
<h3><a href="http://layersmagazine.com/magazine-cover-design-in-indesign.html">Magazine Cover with InDesign</h3>
<p><a href="http://layersmagazine.com/magazine-cover-design-in-indesign.html"><img src="http://designm.ag/wp-content/uploads/2011/10/04-magazine-cover.jpg" class="imgborder" /></a></p>
<h3><a href="http://layersmagazine.com/using-indesign-to-publish-your-ipad-magazine.html">Publishing an iPad Magazine</h3>
<p><a href="http://layersmagazine.com/using-indesign-to-publish-your-ipad-magazine.html"><img src="http://designm.ag/wp-content/uploads/2011/10/05-ipad-magazine.jpg" class="imgborder" /></a></p>
<h3><a href="http://indesignsecrets.com/creating-percentage-based-styles.php">Creating Percentage-Based Styles</h3>
<p><a href="http://indesignsecrets.com/creating-percentage-based-styles.php"><img src="http://designm.ag/wp-content/uploads/2011/10/06-percentages.jpg" class="imgborder" /></a></p>
<h3><a href="http://indesignsecrets.com/hidden-gems-the-story-editor.php">Hidden Gems: The Story Editor</h3>
<p><a href="http://indesignsecrets.com/hidden-gems-the-story-editor.php"><img src="http://designm.ag/wp-content/uploads/2011/10/07-story-editor.jpg" class="imgborder" /></a></p>
<h3><a href="http://blogs.adobe.com/indesigndocs/2009/05/creating_pdf_forms_in_indesign.html">InDesign: Creating PDF Forms</h3>
<p><a href="http://blogs.adobe.com/indesigndocs/2009/05/creating_pdf_forms_in_indesign.html"><img src="http://designm.ag/wp-content/uploads/2011/10/08-pdf-forms.jpg" class="imgborder" /></a></p>
<h3><a href="http://indesignsecrets.com/how-to-mirror-a-layout.php">How to Mirror a Layout</h3>
<p><a href="http://indesignsecrets.com/how-to-mirror-a-layout.php"><img src="http://designm.ag/wp-content/uploads/2011/10/09-layout-mirror.jpg" class="imgborder" /></a></p>
<h3><a href="http://layersmagazine.com/using-the-next-style-paragraph-feature-in-indesign.html">InDesign Next Paragraph Feature</h3>
<p><a href="http://layersmagazine.com/using-the-next-style-paragraph-feature-in-indesign.html"><img src="http://designm.ag/wp-content/uploads/2011/10/10-next-paragraph.jpg" class="imgborder" /></a></p>
<h3><a href="http://layersmagazine.com/creating-an-interactive-portfolio-with-indesign-cs3.html">Creating an Interactive Portfolio with InDesign CS3</h3>
<p><a href="http://layersmagazine.com/creating-an-interactive-portfolio-with-indesign-cs3.html"><img src="http://designm.ag/wp-content/uploads/2011/10/11-interactive-portfolio.jpg" class="imgborder" /></a></p>
<h3><a href="http://creativecurio.com/2008/07/indesign-project-bleed-and-layering-master-pages/">Bleed and Layering Master Pages</h3>
<p><a href="http://creativecurio.com/2008/07/indesign-project-bleed-and-layering-master-pages/"><img src="http://designm.ag/wp-content/uploads/2011/10/12-layering-master-pages.jpg" class="imgborder" /></a></p>
<h3><a href="http://layersmagazine.com/magazine-design-indesign1.html">Magazine Design (Part 1 of 3)</h3>
<p><a href="http://layersmagazine.com/magazine-design-indesign1.html"><img src="http://designm.ag/wp-content/uploads/2011/10/13-indesign-magazine-styles.jpg" class="imgborder" /></a></p>
<h3><a href="http://circleboxblog.com/2010/tutorials/indesign-workflow-tips-improving-your-workspace-and-working-with-master-pages/">Improving Your Workspace Layout</h3>
<p><a href="http://circleboxblog.com/2010/tutorials/indesign-workflow-tips-improving-your-workspace-and-working-with-master-pages/"><img src="http://designm.ag/wp-content/uploads/2011/10/14-indesign-cs4-layout-workflow.jpg" class="imgborder" /></a></p>
<h3><a href="http://vector.tutsplus.com/tutorials/layout/basic-page-numbering-with-indesign-cs5/">Basic Page Numbering</h3>
<p><a href="http://vector.tutsplus.com/tutorials/layout/basic-page-numbering-with-indesign-cs5/"><img src="http://designm.ag/wp-content/uploads/2011/10/15-basic-page-numbering.jpg" class="imgborder" /></a></p>
<h3><a href="http://www.gomediazine.com/tutorials/tools-tips/preparing-indesign-files-for-your-print-service/">Preparing for Print Services</h3>
<p><a href="http://www.gomediazine.com/tutorials/tools-tips/preparing-indesign-files-for-your-print-service/"><img src="http://designm.ag/wp-content/uploads/2011/10/16-printer-package-style.jpg" class="imgborder" /></a></p>
<h3><a href="http://vector.tutsplus.com/tutorials/designing/quick-tip-how-to-batch-replace-characters-and-glyphs/">How to Batch Replace Characters and Glyphs</h3>
<p><a href="http://vector.tutsplus.com/tutorials/designing/quick-tip-how-to-batch-replace-characters-and-glyphs/"><img src="http://designm.ag/wp-content/uploads/2011/10/17-batch-replace.jpg" class="imgborder" /></a></p>
<h3><a href="http://vector.tutsplus.com/tutorials/tools-tips/the-layers-panel-indesign-cs5/">The Layers Panel in CS5</h3>
<p><a href="http://vector.tutsplus.com/tutorials/tools-tips/the-layers-panel-indesign-cs5/"><img src="http://designm.ag/wp-content/uploads/2011/10/18-layers-indesign-cs5.jpg" class="imgborder" /></a></p>
<h3><a href="http://vector.tutsplus.com/tutorials/designing/quick-tip-setting-margins-using-indesign/">Setting Margins with InDesign CS5</h3>
<p><a href="http://vector.tutsplus.com/tutorials/designing/quick-tip-setting-margins-using-indesign/"><img src="http://designm.ag/wp-content/uploads/2011/10/19-indesign-margins.jpg" class="imgborder" /></a></p>
<h3><a href="http://vector.tutsplus.com/tutorials/tools-tips/quick-tip-create-compound-frames-in-indesign-cs5/">Creating Compound Frames</h3>
<p><a href="http://vector.tutsplus.com/tutorials/tools-tips/quick-tip-create-compound-frames-in-indesign-cs5/"><img src="http://designm.ag/wp-content/uploads/2011/10/20-compound-frames.jpg" class="imgborder" /></a></p>
<h3><a href="http://vector.tutsplus.com/tutorials/tools-tips/quick-tip-how-to-use-notes-and-add-comments-to-indesign-cs5-documents/">Notes and Comments in CS5</h3>
<p><a href="http://vector.tutsplus.com/tutorials/tools-tips/quick-tip-how-to-use-notes-and-add-comments-to-indesign-cs5-documents/"><img src="http://designm.ag/wp-content/uploads/2011/10/21-notes-taking.jpg" class="imgborder" /></a></p>
<h3><a href="http://thestockwell.com/indesign-new-document-window-explained/">New Document Window Explained</h3>
<p><a href="http://thestockwell.com/indesign-new-document-window-explained/"><img src="http://designm.ag/wp-content/uploads/2011/10/22-new-document-window.jpg" class="imgborder" /></a></p>
<h3><a href="http://thestockwell.com/how-to-add-crop-marks-to-a-layout-in-indesign-cs4-in-a-snap/">Crop Markers in CS4</h3>
<p><a href="http://thestockwell.com/how-to-add-crop-marks-to-a-layout-in-indesign-cs4-in-a-snap/"><img src="http://designm.ag/wp-content/uploads/2011/10/23-crop-markers.jpg" class="imgborder" /></a></p>
<h3><a href="http://layersmagazine.com/conditional-text-and-indesign-cs4.html">Conditional Text for InDesign CS4</h3>
<p><a href="http://layersmagazine.com/conditional-text-and-indesign-cs4.html"><img src="http://designm.ag/wp-content/uploads/2011/10/24-conditional-text.jpg" class="imgborder" /></a></p>
<h3><a href="http://vector.tutsplus.com/tutorials/designing/writing-effectively-in-indesign-using-book/">Writing an Effective Book Document</h3>
<p><a href="http://vector.tutsplus.com/tutorials/designing/writing-effectively-in-indesign-using-book/"><img src="http://designm.ag/wp-content/uploads/2011/10/25-indesign-book-writing-style.jpg" class="imgborder" /></a></p>
<br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=46384&c=1328134110' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=46384&c=1328134110' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></content:encoded>
			<wfw:commentRss>http://designm.ag/tutorials/25-unique-adobe-indesign-tutorials-for-newbies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Animate Threaded Comments with CSS and jQuery</title>
		<link>http://designm.ag/tutorials/how-to-animate-threaded-comments-with-css-and-jquery/</link>
		<comments>http://designm.ag/tutorials/how-to-animate-threaded-comments-with-css-and-jquery/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 16:13:03 +0000</pubDate>
		<dc:creator>Jake Rocheleau</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[threaded]]></category>

		<guid isPermaLink="false">http://designm.ag/?p=46114</guid>
		<description><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=46114&c=1822520916' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=46114&c=1822520916' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>With many social applications the use of threaded comments has become a staple in functionality. Webmasters today are focusing much more on user experience rather than content generation, and because of this there has been a rise in custom animation effects.</p>

<p>Below I'll be going over a guide to building your own custom jQuery threaded comments from scratch. For the ease of our tutorial we won't be using any backend system to actually store the data anywhere. This means <strong>no MySQL databases</strong> or PHP calls to a server - all comments are added in-page and will be lost upon page refresh.</p>

<p style="text-align:center"><a href="http://designm.ag/previews/animated-comments/index.html"><img class="imgborder" src="http://designm.ag/wp-content/uploads/2011/09/jquery-comments-preview.jpg" alt="jQuery Animated Comments Thread" /></a></p><br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=46114&c=1339040599' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=46114&c=1339040599' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=46114&c=1333092473' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=46114&c=1333092473' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>With many social applications the use of threaded comments has become a staple in functionality. Webmasters today are focusing much more on user experience rather than content generation, and because of this there has been a rise in custom animation effects.</p>
<p>Below I&#8217;ll be going over a guide to building your own custom jQuery threaded comments from scratch. For the ease of our tutorial we won&#8217;t be using any backend system to actually store the data anywhere. This means <strong>no MySQL databases</strong> or PHP calls to a server &#8211; all comments are added in-page and will be lost upon page refresh.</p>
<p style="text-align:center"><a href="http://designm.ag/previews/animated-comments/index.html"><img class="imgborder" src="http://designm.ag/wp-content/uploads/2011/09/jquery-comments-preview.jpg" alt="jQuery Animated Comments Thread" /></a></p>
<p><span id="more-46114"></span></p>
<p style="text-align:center"><strong><a href="http://designm.ag/previews/animated-comments/index.html" target="_blank">Live Demo</a></strong> &#8211; <strong><a href="http://designm.ag/previews/animated-comments/source/animated-comments-source.zip">Download Source Code</a></strong></p>
<p>Granted, the system is very simple to work with and extrapolate data from. This tutorial not only introduces the inner workings of jQuery, but gives developers a framework of which to base a simple comments application on.</p>
<p>As always if you have questions feel free to post them in the comments below. Much of the code introduced here is easy to understand and well documented in the <a href="http://docs.jquery.com/Main_Page">jQuery wiki</a>.</p>
<h2>Starting with Core HTML</h2>
<p>To get started we should focus on document structure and HTML processing. Jumping into the beginning I&#8217;ve created a directory named <em>jquery-comments</em> which will include all of our project files. There isn&#8217;t much required to include here.</p>
<p>The list starts with an <em>index.html</em> and <em>style.css</em> document overview. These two docs will contain your page structure and layout, respectively. We&#8217;ll also need a .js file to house our custom jQuery functionality. I&#8217;ve named this file &#8220;jcs.js&#8221;, short for jQuery comments. But feel free to name the script anything you desire.</p>
<p><img src="http://designm.ag/wp-content/uploads/2011/09/threaded-comments-full.jpg" alt="Full Preview for Application" /></p>
<p>The last step I&#8217;ve done is to create an images directory. Inside I have a few pre-cropped avatars for our example, along with a comment bubble icon for additional page effects. To get started let&#8217;s example the proper code inside index.html first!</p>
<p>[cc lang="html"]</p>
<p>[/cc]</p>
<p>We have a heading area just like any other webpage instilled at the top of our document. Inside we&#8217;ve included our style.css and also our remote JavaScript file. Additionally I&#8217;ve added the jQuery 1.4.2 miniaturized library hosted in Google&#8217;s code repositories. This has the benefit of reducing calls to the server at runtime and keeping your physical file count low.</p>
<h2>Comment Blocks</h2>
<p>Inside our body we have a division with an ID &#8220;comments&#8221;. Inside this is where all our code resides. To dive right in let&#8217;s examine a piece of code containing the first 3 page comments. The 1st in our set is the root node while the other two are threaded replies.</p>
<p>[cc lang="html"] <!-- first thread --></p>
<div class="comment-thread">
<div class="comment-block">
        <a href="#" class="author-avatar"><img src="http://designm.ag/wp-content/uploads/2011/09/avatar1.png" alt="userman" /></a></p>
<p class="comment-top-meta"><strong>userman</strong> <span>posted 7 hr 32 min ago</span></p>
<div class="comment-content">
<p class="the-comment-post">Here is some sample text for a comment. Man what a nice day outside!</p>
<p class="comment-reply-options"><a class="option-reply">Reply</a></p>
<div class="showhidecommform"> </div>
</p></div>
</p></div>
<div class="thread-replies">
<div class="comment-thread">
<div class="comment-block">
                <a href="#" class="author-avatar"><img src="http://designm.ag/wp-content/uploads/2011/09/avatar2.png" alt="DuckDude" /></a></p>
<p class="comment-top-meta"><strong>DuckDude</strong> <span>posted 5 hr 11 min ago</span></p>
<div class="comment-content">
<p class="the-comment-post">Here is a unique rebuttal. Hmm&#8230;</p>
<p class="comment-reply-options"><a class="option-reply">Reply</a></p>
<div class="showhidecommform"> </div>
</p></div>
</p></div>
<div class="thread-replies"></div>
</p></div>
<div class="comment-thread">
<div class="comment-block">
                <a href="#" class="author-avatar"><img src="http://designm.ag/wp-content/uploads/2011/09/avatar3.png" alt="snowhockey1" /></a></p>
<p class="comment-top-meta"><strong>snowhockey1</strong> <span>posted 4 hr 16 min ago</span></p>
<div class="comment-content">
<p class="the-comment-post">Also, by the way if you were wondering. This isn&#8217;t a real username it&#8217;s actually pretty fake.
<p class="comment-reply-options"><a class="option-reply">Reply</a></p>
<div class="showhidecommform"> </div>
</p></div>
</p></div>
<div class="thread-replies"></div>
</p></div>
</p></div>
</div>
<p><!-- @end first thread --><br />
[/cc]</p>
<p>The code may seem a bit messy at first, but each section does have an echo effect. Each comment in-page is housed inside a div with the class &#8220;comment-thread&#8221;. The container divisions for &#8220;comment-block&#8221; houses all of the comment information.</p>
<p>This includes the username and avatar, date/time of posting, comment content, and reply button. Directly after this area we have a new opening division classed under &#8220;thread-replies&#8221;. Note this is still inside our root node &#8220;comment-thread&#8221; and will contain further <strong>threaded replies</strong> to our original.</p>
<p><a href="http://www.flickr.com/photos/dcmetroblogger/2270162435/"><img src="http://designm.ag/wp-content/uploads/2011/09/linux-kernal-reload.jpg" alt="Linux Reboot Kernels" /></a></p>
<p>If you examine the threaded replies closely you&#8217;ll notice not only are they also enclosed inside a &#8220;comment-thread&#8221; but each has their own &#8220;thread-replies&#8221; section. For internal comments this div is left blank on purpose &#8211; this is how we can use jQuery to manipulate and add further comments without refreshing the page.</p>
<p>You may also notice each <em>comment-block</em> contains a unique ID parameter. This would be set by an internal system giving each new comment an incrementing ID value. I&#8217;ve generated static values and added them directly into the HTML code per this example, although it&#8217;s fully customizable from any alternative CMS.</p>
<h2>Accessing the DOM with jQuery</h2>
<p>The Document Object Model is a structural way of viewing each web page. It&#8217;s built upon HTML nodes which are referenced with each page element and housed within contain child element(s).</p>
<p>With jQuery we are able to access individual elements in our page and manipulate their information. Not only this, but we are also able to add new page elements without even so much as a refresh! Getting started with jQuery code, added below is the first few lines in our script.</p>
<p>[cc lang="javascript"]$(document).ready(function() {<br />
    var totalcommid = 31;</p>
<p>    $(&#8220;.option-reply&#8221;).live(&#8220;click&#8221;, function() {<br />
[/cc]</p>
<p>We start off with a standard <em>document.ready()</em> clause checking if our page has fully loaded. Once the DOM is ready we can start calling functions and pulling data. We have a single variable set named <strong>totalcommid</strong>. This is a static number put in place so we don&#8217;t accidentally overwrite any existing comment IDs.</p>
<p>The next line is a selector targeting all elements under the classname &#8220;option-reply&#8221;. These happen to be the small &#8220;Reply&#8221; hyperlinks placed after each comment. Our code is checking for a click event handler to call an internal function.</p>
<p>In layman&#8217;s terms this means jQuery puts a trigger on each &#8220;reply&#8221; link in our page. Every time one of them is clicked we have an internal function called to display a new comment text field. Once added we either have the option of closing the comment box or adding new content and appending our comment into the thread.</p>
<p>[cc lang="javascript"]var currtxt = $(this).text();<br />
var curroptlink = $(this);<br />
var cid = $(this).parent().parent().parent().attr(&#8220;id&#8221;);<br />
var poundcid = &#8220;#link-&#8221;+cid;</p>
<p>var htmlform = &#8216;&lt;form id=&#8221;commsubform&#8221;&gt;&lt;label&gt;Add Comment:&lt;/label&gt; &lt;textarea id=&#8221;thecomment&#8221; class=&#8221;commtxtfield&#8221;&gt;&lt;/textarea&gt; &lt;br /&gt;&lt;br /&gt; &lt;a class=&#8221;savecommbtn&#8221; id=&#8221;link-&#8217;+cid+&#8217;&#8221;&gt;Save Comment&lt;/a&gt;&lt;/form&gt;&#8217;;<br />
[/cc]</p>
<p>The first thing we set are common page variables which we&#8217;ll be accessing repeatedly. <em>currtxt</em> is set to the current selector&#8217;s text value. <em>curroptlink</em> is a selector targeting the current link we&#8217;ve just clicked. Although the code seems mildly repetitive it can save time when manipulating data later in our function.</p>
<p><a href="http://www.flickr.com/photos/xelcise/4990708651/"><img src="http://designm.ag/wp-content/uploads/2011/09/jquery-dev-laptop.jpg" alt="jQuery programming on laptop studio" /></a></p>
<p><em>cid</em> is a unique variable which contains our current comment thread ID. This takes a bit of DOM traversing until we get to the proper parent element containing our ID value. This is one great aspect to working with jQuery since each comment we add will have the same format, thus our code is fully functional and expands regardless of how many threads.</p>
<p>Our <em>htmlform</em> variable should be pretty self-explanatory. It contains all the HTML code needed to embed into the page for a new comment form. Note we make good use of our <em>cid</em> variable by giving our save link the value of our next comment ID.</p>
<h2>Functional Page Manipulation</h2>
<p>From here we&#8217;ve got most of the variables we need set and ready. We&#8217;re already inside of our selector and just need to offer a few more bits of code to exercise.</p>
<p>Getting started we have to understand when our users want to show or hide the comment form. It should be just as easy to close a reply box as to open it. We can accomplish this task with two individual toggle functions based on the current link text.</p>
<p>[cc lang="javascript"]// toggle between show/hide comment form views<br />
if(currtxt == &#8220;Reply&#8221;) {<br />
    $(this).parent().next(&#8220;.showhidecommform&#8221;).html(htmlform);<br />
    $(this).text(&#8220;Hide form&#8221;);<br />
}</p>
<p>if(currtxt != &#8220;Reply&#8221;) {<br />
    curroptlink.parent().next(&#8220;.showhidecommform&#8221;).html(&#8220;&nbsp;&#8221;);<br />
    curroptlink.text(&#8220;Reply&#8221;);<br />
}<br />
[/cc]</p>
<p>The logic here is very simple but works well for what we need. Broken apart we see <strong>2 if conditional statements</strong> checking the value of our current link text. If the link text says &#8220;Reply&#8221; we add a new comment form and change the link text to &#8220;Hide Form&#8221;. If the opposite is true then we just reverse our actions.</p>
<p>The power over documents we control here is only accessible from the many variables we declared earlier in the script. We could change a few more things about the page when a reply link is clicked, although I&#8217;ll leave that for you to customize.</p>
<p>The last and final piece of code will translate our comment into an HTML block and append it into the page. Our first jQuery selector looks for an element tagged to the variable <em>poundcid</em>.</p>
<p>[cc lang="javascript"]// begin translating our comment<br />
$(poundcid).live(&#8220;click&#8221;, function() {<br />
    var newcomtxt = $(&#8216;textarea#thecomment&#8217;).val();<br />
    var targetcontainer = &#8220;#&#8221;+cid;</p>
<p>    var newcommhtml = &#8216;
<div class="comment-thread">
<div class="comment-block"> <a href="#" class="author-avatar"><img src="images/avatar2.png" alt="anonymous" /></a>
<p class="comment-top-meta"> <strong>anonymous</strong> <span>posted 1 sec ago</span></p>
<div class="comment-content">
<p class="the-comment-post">&#8216; + newcomtxt + &#8216;</p>
<p class="comment-reply-options"><a class="option-reply">Reply</a></p>
<div class="showhidecommform"> </div>
</p></div>
</p></div>
<div class="thread-replies"></div>
</p></div>
<p>&#8216;;</p>
<p>    $(targetcontainer).next(&#8220;.thread-replies&#8221;).hide().append(newcommhtml).fadeIn();</p>
<p>    curroptlink.trigger(&#8220;click&#8221;);<br />
});<br />
[/cc]</p>
<p><a href="http://www.flickr.com/photos/nrkbeta/2255170571/"><img src="http://designm.ag/wp-content/uploads/2011/09/digg-popular-content-screen.jpg" alt="Digg Homescreen capture" /></a></p>
<p>This variable was set earlier in our code and targets the save link we generate with each new comment reply field. For this we add another <em>live()</em> click event handler and call another internal function upon saving.</p>
<h2>Adding New Threads Dynamically</h2>
<p>The variable <em>newcomtxt</em> is used to pull the current value of our text field and store it. <em>targetcontainer</em> is targeting the root thread based on the ID value. We are adding a hash/pound symbol (&#8220;#&#8221;) beforehand so we can target the variable inside a jQuery call.</p>
<p><em>newcommhtml</em> is our largest variable and will be appended over and over into our document. This contains all the commenter&#8217;s information &#8211; username (in this case <strong>anonymous</strong>), datetime of posting, and avatar. You may notice there is also built-in code so for each new comment you add there will also be a matching &#8220;Reply&#8221; feature for further threading.</p>
<p>The second-to-last line is where we target and append our new HTML. We first grab our root element and find the first (and only) iteration of the &#8220;thread-replies&#8221; div.</p>
<p>First we call the <em>hide()</em> function to hide all internal content. This gives the animated effect of a fade-in when each new comment is added. We then append our HTML code from the variable above along with a <a href="http://api.jquery.com/fadeIn/">fadeIn() function call</a>.</p>
<p><a href="http://www.flickr.com/photos/dansays/2249414769/"><img src="http://designm.ag/wp-content/uploads/2011/09/computer-registration-forms.jpg" alt="computer registration forms" /></a></p>
<p>The <em>trigger()</em> function is called on our <em>curroptlink</em> to force a click event. This points towards our current option link, which at the end of adding a comment should be labeled &#8220;Hide Form&#8221;. This last line of code makes sure to remove our comment field after successfully adding the comment information into our page.</p>
<p>The last bits of code required will close off our 2 initial jQuery selectors. These include our first click event handler along with the <code>DOM.ready()</code> statement. To finish our commands we first increment the comments ID by 1 and return a false Boolean value to stop the page from reloading.</p>
<p>[cc lang="javascript"]    totalcommid++;</p>
<p>        return false;<br />
    });<br />
});<br />
[/cc]</p>
<h2>Conclusion</h2>
<p>And that&#8217;s all we need! The jQuery code may seem a bit intimidating at first glance, especially if you haven&#8217;t spent much time in the language. However I can vouch in stating jQuery doesn&#8217;t take much time to learn and even newbies to JavaScript will pick up the conventions quickly.</p>
<p>If you have the interest feel free to build around this comment system to include your own server-side functionality. This could include a database system with Ajax calls to permanently store each comment locally with a matching ID.</p>
<p>There are so many things which can be done under the power of jQuery. If you&#8217;re interested further try downloading the project demo code and going over a few of the options yourself.</p>
<br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=46114&c=92450288' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=46114&c=92450288' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></content:encoded>
			<wfw:commentRss>http://designm.ag/tutorials/how-to-animate-threaded-comments-with-css-and-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Create a jQuery Animated Sliding Sub-Menu Navigation</title>
		<link>http://designm.ag/tutorials/how-to-create-a-jquery-animated-sliding-sub-menu-navigation/</link>
		<comments>http://designm.ag/tutorials/how-to-create-a-jquery-animated-sliding-sub-menu-navigation/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 20:53:34 +0000</pubDate>
		<dc:creator>Jake Rocheleau</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://designm.ag/?p=45509</guid>
		<description><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=45509&c=582124536' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=45509&c=582124536' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>We have seen a lot of different jQuery techniques over the years. This comes at a time when website navigation is at an utmost importance. User experience is key in all forms of design. Without perfecting your layout it will be difficult to keep visitors coming back for more. And with so many <a href="http://designm.ag/resources/jquery-navigation-plugins/">jQuery Plugins for Navigation</a> it's hard to miss something great.</p>

<p>Below I'll be going into the code for developing a very basic dropdown navigation in jQuery. This will include a sub-menu of links to different profiles such as Twitter and Facebook. To create your own setup I would recommend checking <a href="http://www.iconfinder.com/">Icon Finder</a> to match any social networks you enjoy. But this navigation can be used for almost anything requiring a drop-down setup.</p>

<p style="text-align: center"><a href="http://designm.ag/previews/sliding-nav-menu/index.html"><img class="imgborder" src="http://designm.ag/wp-content/uploads/2011/08/sliding-nav-jquery-menu.jpg" alt="DesignMag Sliding jQuery Navigation Menu Tutorial Demo" /></a></p><br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=45509&c=425225111' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=45509&c=425225111' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=45509&c=256544363' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=45509&c=256544363' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>We have seen a lot of different jQuery techniques over the years. This comes at a time when website navigation is at an utmost importance. User experience is key in all forms of design. Without perfecting your layout it will be difficult to keep visitors coming back for more. And with so many <a href="http://designm.ag/resources/jquery-navigation-plugins/">jQuery Plugins for Navigation</a> it&#8217;s hard to miss something great.</p>
<p>Below I&#8217;ll be going into the code for developing a very basic dropdown navigation in jQuery. This will include a sub-menu of links to different profiles such as Twitter and Facebook. To create your own setup I would recommend checking <a href="http://www.iconfinder.com/">Icon Finder</a> to match any social networks you enjoy. But this navigation can be used for almost anything requiring a drop-down setup.</p>
<p style="text-align: center"><a href="http://designm.ag/previews/sliding-nav-menu/index.html"><img class="imgborder" src="http://designm.ag/wp-content/uploads/2011/08/sliding-nav-jquery-menu.jpg" alt="DesignMag Sliding jQuery Navigation Menu Tutorial Demo" /></a></p>
<p><span id="more-45509"></span></p>
<p style="text-align: center"><strong><a href="http://designm.ag/previews/sliding-nav-menu/index.html">Live Demo</a></strong> &#8211; <strong><a href="http://designm.ag/previews/sliding-nav-menu/source/sliding-nav-source.zip">Download Source Code</a></strong></p>
<h3>Getting Started</h3>
<p>We should first examine the basic HTML structure. I&#8217;m using HTML5 doctype to format the page outline and list structures. It shouldn&#8217;t affect your document or the scripting if you use XHTML or even HTML 4.01. In the header I&#8217;ve included just a few external files for what we need.</p>
<p>First a basic styles.css for laying out our fonts, resets, formatting, etc. I&#8217;ve also included the latest <a href="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js">jQuery 1.6.1 library</a> from Google Code hosting. All of this code is accessible from the demo download above if you need a better view. But I&#8217;ve included a bit of the header below:</p>
<p>[cc lang="html"]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html lang=&#8221;en&#8221;&gt;<br />
&lt;head&gt;<br />
	&lt;title&gt;jQuery Animated Sliding Menu Navigation[DEMO]&lt;/title&gt;<br />
	&lt;style type=&#8221;text/css&#8221; media=&#8221;all&#8221;&gt;<br />
	@import url(http://fonts.googleapis.com/css?family=Gloria+Hallelujah);<br />
	&lt;/style&gt;<br />
	&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;styles.css&#8221; /&gt;<br />
	&lt;script type=&#8217;text/javascript&#8217; src=&#8217;http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js&#8217;&gt;&lt;/script&gt;<br />
&lt;/head&gt;<br />
[/cc]</p>
<p>Many of you may have also noticed I&#8217;ve included an @import statement for external CSS styles. Namely these are being loaded from <a href="http://www.google.com/webfonts">Google Web Fonts</a> to include an alternative for our header text. I&#8217;ll explain how to use these fonts a bit later in the tutorial. For now let&#8217;s finish one more aspect of the HTML &#8211; our navigation menu!</p>
<p>In the content area I&#8217;ve used HTML5 sections for labeling off areas. The right column will contain our dropdown navigation and a small header. I&#8217;ve decided to use an unordered list for simplicities sake. This has the ID #slidenav while each internal list item has the class .nitem. Note that only root items will have the .nitem class, <strong>not</strong> our sub-menu nav.</p>
<p>[cc lang="html"]<br />
<section>
<h3>Our Friends</h3>
<ul>
<li class="nitem"><a href="#"><span><img src="img/twitter.png" /></span> Twitter</a></li>
<ul class="nsub">
<li><a href="http://twitter.com/designmagtweets">@DesignMagTweets</a></li>
<li><a href="http://twitter.com/smashingmag">@SmashingMag</a></li>
<li><a href="http://twitter.com/hongkiat">@hongkiat</a></li>
<li><a href="http://twitter.com/noupemag">@noupemag</a></li>
<li><a href="http://twitter.com/culturedcode">@culturedcode</a></li>
</ul>
<li class="nitem"><a href="#"><span><img src="img/facebook.png" /></span> Facebook</a></li>
<ul class="nsub">
<li><a href="http://www.facebook.com/Starbucks">Starbucks</a></li>
<li><a href="http://www.facebook.com/smashmag">Smashing Mag</a></li>
<li><a href="http://www.facebook.com/skittles">Skittles</a></li>
<li><a href="http://www.facebook.com/threadless">Threadless</a></li>
</ul>
<li class="nitem"><a href="#"><span><img src="img/dribbble.png" /></span> Dribbble</a></li>
<ul class="nsub">
<li><a href="http://dribbble.com/dburka">Daniel Burka</a></li>
<li><a href="http://dribbble.com/maxvoltar">Tim Van Damme</a></li>
<li><a href="http://dribbble.com/owltastic">Meagan Fisher</a></li>
<li><a href="http://dribbble.com/squaredeye">Matthew Smith</a></li>
<li><a href="http://dribbble.com/kadasarva">Alex Volkov</a></li>
<li><a href="http://dribbble.com/joshhemsley">Josh Hemsley</a></li>
<li><a href="http://dribbble.com/brdrck">Jeff Broderick</a></li>
</ul>
<li class="nitem"><a href="#"><span><img src="img/digg.png" /></span> Digg</a></li>
<ul class="nsub">
<li><a href="http://digg.com/kevinrose">Kevin Rose</a></li>
<li><a href="http://digg.com/alexalbrecht">Alex Albrecht</a></li>
<li><a href="http://digg.com/mrbabyman">Mr. Baby Man</a></li>
<li><a href="http://digg.com/ltgenpanda">Lt Gen Panda</a></li>
<li><a href="http://digg.com/thepowerdigger">Power Digger</a></li>
</ul>
<li class="nitem"><a href="#"><span><img src="img/gowalla.png" /></span> Gowalla</a></li>
<ul class="nsub">
<li>Sorry!! Nothing here yet&#8230;</li>
</ul>
</ul>
</section>
<p>[/cc]</p>
<p>Instead I&#8217;ve used a much simpler technique to append sub lists directly after the list item. We can give each a class of .nsub and use jQuery later to hide them. The icons I&#8217;m using are each separated by span elements with different IDs. I&#8217;ve used these in CSS styles for positioning. But they can also be useful for other functionality &#8211; if you wish to replace the icon on hover, for example.</p>
<h3>Breaking into Web Fonts</h3>
<p>We should now jump ahead into coding our CSS. Styles are just as easy to understand as HTML elements and certainly if you understand the document structure. I won&#8217;t be explaining the whole stylesheet since it doesn&#8217;t include a ton of new features. But let&#8217;s start with the inclusion of Google&#8217;s webfont system.</p>
<p>From their <a href="http://www.google.com/webfonts">main page</a> Google web fonts can seem confusing. But broken down into steps, you&#8217;re merely:</p>
<ul>
<li>choosing a font or fonts you wish to include in your page</li>
<li>including the external CSS into your page</li>
<li>start using font names in font-family property</li>
</ul>
<p>Google actually lets you use the specific font name for anything you&#8217;d like! So in my example we are including a new font <strong>Gloria Hallelujah</strong>. I could have included many fonts in one stylesheet from Google, but honestly we don&#8217;t need any more. It takes a lot longer for pages to load the more fonts you include through Google, so it&#8217;s best to limit below 5 or 6.</p>
<p>[cc lang="css"]h1 { font-family: &#8216;Gloria Hallelujah&#8217;, cursive, Georgia, sans-serif; font-size: 4.6em; color: #666; text-transform: none; line-height: 2.2em;  }<br />
[/cc]</p>
<p>In the above code we&#8217;re adding this font family as our priority 1 font. If Google is unable to load for some reason we can fallback onto Georgia or sans-serif. A very simple technique, yet powerful in today&#8217;s modern web sphere. We should now focus on coding our sliding navigation and animating with jQuery.</p>
<h3>Sliding Nav List CSS</h3>
<p>It&#8217;s best to start by planning ahead for our #slidenav list. This ID is used to target the majority of our internal styles, even relative to our sub navigation lists. We set all the list items to 1.6em Arial fonts. But the padding and line-height is all added into our anchor links, that way they can display as block elements.</p>
<p>[cc lang="css"]/* @group sliding nav */<br />
#slidenav { margin-bottom: 15px; }<br />
#slidenav li { font-family: Arial, Verdana, sans-serif; font-size: 1.6em; font-weight: bold; margin-bottom: 2px; }<br />
#slidenav li a { display: block; padding: 2px 10px; text-decoration: none; color: #dedede; line-height:40px; }<br />
#slidenav li a:hover { background: #eaf3f9; color: #939393; }</p>
<p>#slidenav .nsub { font-size: 0.7em; font-style: italic; padding-left: 22px; }<br />
#slidenav .nsub li { padding: 0; color: #666; }<br />
#slidenav .nsub li a { color: #a9cee9; line-height: 1.7em; }<br />
#slidenav .nsub li a:hover { text-decoration: underline; color: #4198da; background: #fff; }<br />
[/cc]</p>
<p>The .nsub class works in a very similar way. We append this onto any sub-list of links and all the subsequent items. For the sub links I&#8217;ve removed a lot of the padding so these will actually list out like anchor links. Otherwise we would be taking up a lot of unneeded space on screen. I&#8217;ve also simplified the hover effects quite a bit.</p>
<p>Hopefully you can see the document order and understand how our page layout is being constructed. Again I recommend downloading our source archive if you need to look at the whole code. But with this in mind let&#8217;s move into the basic jQuery functionality.</p>
<h3>jQuery Magic</h3>
<p>There isn&#8217;t a whole bunch of code required to get this working. I&#8217;ve chosen to place the scripting inline with our HTML code, towards the very bottom of our page document. Placing your script tags right before the closing &lt;/body&gt; will let the page fully load before getting hung up on JavaScripting. You may not even notice much of a difference &#8211; so feel free to write your code anywhere internal or external.</p>
<p>We need to start by calling our $(document).ready() status. jQuery will recognize to hold off on any effects until after the page finishes loading. This is standard within any jQuery script <a href="http://designshack.co.uk/articles/html/deeper-study-into-the-wwws-document-object-model/">manipulating the Document Object Model</a>. We are targeting all .nsub elements on page and choosing to <a href="http://api.jquery.com/hide/">hide()</a> them by default. This prevents our sub lists from displaying all at once.</p>
<p>[cc lang="javascript"]$(document).ready(function() {<br />
	    $(&#8216;.nsub&#8217;).hide(); // hide sub-navigation items by default</p>
<p>	    $(&#8216;.nitem a&#8217;).live(&#8216;click&#8217;, function(e){<br />
		e.preventDefault();<br />
		$(this).parent().next(&#8216;.nsub&#8217;).slideToggle(&#8216;slow&#8217;);</p>
<p>		if($(this).parent().next(&#8216;.nsub&#8217;).is(&#8216;:hidden&#8217;)) {<br />
                            $(this).addClass(&#8220;CurrentlySelected&#8221;);<br />
                        } else {<br />
                            $(this).removeClass(&#8220;CurrentlySelected&#8221;);<br />
                	}<br />
	   });<br />
});<br />
[/cc]</p>
<p>We can trace the majority of our animation to a live click event handler. This is demonstrated in the code above by checking each anchor link nested inside a .nitem class. Whenever one of these links are clicked we immediately call <a href="http://api.jquery.com/event.preventDefault/">preventDefault()</a> on the event. This will disable the href value on the links so our page won&#8217;t be redirected.</p>
<p>Next we&#8217;re using a bit of document node traversing to target sub-lists. From the anchor link we call <code>parent().next('.nsub')</code> to lock onto the next sub navigation list. We can use the <a href="http://api.jquery.com/slideToggle/">slideToggle()</a> method to transition between showing and hiding these lists. This is one robust method with a few possible customizations in the parameters.</p>
<p>And finally we are checking if the sub listing attached to each anchor is hidden or displaying. If hidden we are adding a .CurrentlySelected class. This can be used when you transition from page-to-page keeping each of the menus open. Although this is certainly a simple option there are other alternative ways to code in this functionality. But with this method we can save a few headaches!</p>
<p style="text-align: center"><a href="http://designm.ag/previews/sliding-nav-menu/index.html"><img class="imgborder" src="http://designm.ag/wp-content/uploads/2011/08/sliding-nav-jquery-menu.jpg" alt="DesignMag Sliding jQuery Navigation Menu Tutorial Demo" /></a></p>
<p style="text-align: center"><strong><a href="http://designm.ag/previews/sliding-nav-menu/index.html">Live Demo</a></strong> &#8211; <strong><a href="http://designm.ag/previews/sliding-nav-menu/source/sliding-nav-source.zip">Download Source Code</a></strong></p>
<h3>Conclusion</h3>
<p>Hopefully you&#8217;ve taken away a bit of web design knowledge from this tutorial. We&#8217;ve constructed a full HTML5 layout and used some newer CSS styling techniques throughout. We also touched upon Google Web Fonts and utilizing jQuery effects for displaying and flipping through page elements.</p>
<p>Be sure to download the demo source code for yourself if you&#8217;re interested in tinkering around. Additionally let us know your questions or thoughts in the discussions area below. </p>
<br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=45509&c=1178915220' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=45509&c=1178915220' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></content:encoded>
			<wfw:commentRss>http://designm.ag/tutorials/how-to-create-a-jquery-animated-sliding-sub-menu-navigation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding an Instant Login Form with jQuery and PHP/Ajax</title>
		<link>http://designm.ag/tutorials/coding-an-instant-login-form-with-jquery-and-phpajax/</link>
		<comments>http://designm.ag/tutorials/coding-an-instant-login-form-with-jquery-and-phpajax/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 21:30:51 +0000</pubDate>
		<dc:creator>Jake Rocheleau</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://designm.ag/?p=45492</guid>
		<description><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=45492&c=1858845623' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=45492&c=1858845623' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>Login forms have been around for decades. In web design these are very common with so many social media interactions occurring on a daily basis. However the static web has gone by the wayside to make room for much more dynamic content. With popularity growing for the jQuery library it is only natural to see so many new effects being created.</p>

<p>In this brief tutorial I'm going to explain how to create an instant login form with jQuery and PHP. We won't be accessing any database to keep things simplified for now. Instead I've hard coded a username/password combo just for the demonstration of this article. The form automatically begins checking after you type some information to see when you hit the correct user &#38; password combination!</p>

<p>If you'd like to get a better idea check out the demo link below. I've also provided my source code free to download. The HTML web page will open and run jQuery properly but without a server running PHP the form cannot be processed. Keep this in mind when playing around with the source code.</p>

<p><a href="http://designm.ag/previews/instant-login/index.html"><img class="imgborder" src="http://designm.ag/wp-content/uploads/2011/08/instant-login-jquery-admin.jpg" alt="Demo of Instant Login Form" /></a></p><br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=45492&c=575165838' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=45492&c=575165838' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=45492&c=43646671' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=45492&c=43646671' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>Login forms have been around for decades. In web design these are very common with so many social media interactions occurring on a daily basis. However the static web has gone by the wayside to make room for much more dynamic content. With popularity growing for the jQuery library it is only natural to see so many new effects being created.</p>
<p>In this brief tutorial I&#8217;m going to explain how to create an instant login form with jQuery and PHP. We won&#8217;t be accessing any database to keep things simplified for now. Instead I&#8217;ve hard coded a username/password combo just for the demonstration of this article. The form automatically begins checking after you type some information to see when you hit the correct user &amp; password combination!</p>
<p>If you&#8217;d like to get a better idea check out the demo link below. I&#8217;ve also provided my source code free to download. The HTML web page will open and run jQuery properly but without a server running PHP the form cannot be processed. Keep this in mind when playing around with the source code.</p>
<p><a href="http://designm.ag/previews/instant-login/index.html"><img class="imgborder" src="http://designm.ag/wp-content/uploads/2011/08/instant-login-jquery-admin.jpg" alt="Demo of Instant Login Form" /></a></p>
<p><span id="more-45492"></span></p>
<p style="text-align: center"><strong><a href="http://designm.ag/previews/instant-login/index.html">Live Demo</a></strong> &#8211; <strong><a href="http://designm.ag/previews/instant-login/source/instant-login-source.zip">Download Source Code</a></strong></p>
<h3>Sorting out the HTML</h3>
<p>Let&#8217;s start out by examining the basic page HTML setup. I won&#8217;t cover the entire layout since this is really beginners stuff. But we&#8217;re using an HTML5 doctype in the header with an external stylesheet resource. I&#8217;ve also added the latest <a href="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">jQuery 1.6.2 minified</a> library from Google code servers.</p>
<p>Our main content is held within a div using the ID of #c. This content div will center our page form and give a light background compared to the body. Inside we have a heading and loader div to display the ajax loading button when processing the form values. Also beneath the form is a results div to output information upon successful login.</p>
<p>[cc lang="html"]
<div>
<h1>Instant Login with jQuery/Ajax</h1>
<div><img src="img/fbloader.gif" alt="loading…" /></div>
<form action="" method="post">
	    <label>Username:</label></p>
<p>	    <label>Password:</label></p></form>
<p><em>username: admin / password: password1</em></p>
<div></div>
</div>
<p>[/cc]</p>
<p>This covers a lot of the basics to look at. I&#8217;ll be jumping right into the jQuery code so we can really get into the juicy stuff! One last design topic to mention is the icon we&#8217;ve used to signify a successful login. It&#8217;s a typical style of <a href="http://www.iconfinder.com/icondetails/27530/64/apply_things_icon">Things icon design</a> to feature a glowing box containing a check mark.</p>
<h3>Dynamic Coding in jQuery</h3>
<p>To keep things easy I&#8217;ve included all of the jQuery code directly into the same page as our HTML demo. Within the source files you&#8217;ll find 2 core pieces &#8211; index.html for frontend UI and login.php for processing the form details. The PHP code is beyond simplistic, so don&#8217;t worry if you&#8217;re fairly new to the language.</p>
<p>But to begin with scripting let&#8217;s examine our jQuery clause below. This is included within a script tag directly before my closing body element. At first we check if the document has finished loading to prepare for processing DOM elements. I&#8217;ve initially hidden the #loader div so nothing is displayed until later on.</p>
<p>[cc lang="javascript"]$(document).ready(function() {<br />
	$(&#8220;#loader&#8221;).hide();<br />
[/cc]</p>
<p>From here we&#8217;ll be working within a single event handler function. Whenever the user releases a key on the keyboard <em>(.keyup)</em> we want to check out a whole list of functionality. jQuery is great at building such nested functions in very few lines of code!</p>
<p>[cc lang="javascript"]$(&#8220;#pw, #username&#8221;).keyup(function(){<br />
	var passnum = $(&#8220;#pw&#8221;).val();<br />
	var usernum = $(&#8220;#username&#8221;).val();<br />
[/cc]</p>
<p>You&#8217;ll notice we are using two selectors inside this jQuery event handler call. Whenever the user releases a key on either input field we need to call a fairly large function. Immediately we set 2 variables <strong>passnum</strong> and <strong>usernum</strong> which hold the value of the password and username input, respectively. We&#8217;ll need this in the next segment to check if the values are correct.</p>
<h3>Handling Form Input</h3>
<p>We should now examine the whole jQuery block of code for processing the form data. This is rather lengthy so I&#8217;ve chosen to break it further into two parts. I do recommend downloading the source code instead of copying/pasting from the article so you don&#8217;t get lost!</p>
<p>[cc lang="javascript"]if(passnum.length &gt; 1 &amp;&amp; usernum.length &gt; 2) {<br />
var qry = &#8216;username=&#8217;+ $(&#8220;#username&#8221;).val() + &#8216;&amp;pw=&#8217; + passnum;</p>
<p>if($(&#8220;#loader&#8221;).attr(&#8220;class&#8221;) != &#8220;loading&#8221;) {<br />
	$(&#8220;#loader&#8221;).addClass(&#8220;loading&#8221;);<br />
	$(&#8220;#loader&#8221;).show();<br />
}<br />
[/cc]</p>
<p>We begin with a simple if/else clause to check if the input username is longer than 1 character and the input password is longer than 2. If this is true then we can assume the visitor has entered values into both fields and we should begin checking their credentials. We&#8217;ve put together a new variable named <strong>qry</strong> which stores the query string for our upcoming PHP/Ajax call.</p>
<p>This basically passes the current username and password value directly to the login.php form so we can see if they are correct.  For aesthetics we also check if the #loader div has a class of loading. If not then we know it hasn&#8217;t been activated yet, so we apply the class and show the loading image. In this case I&#8217;ve used <a href="http://www.ajaxload.info/">Ajax Loader</a> to create a Facebook-style .gif animation. Now let&#8217;s examine the code for our ajax call.</p>
<p>[cc lang="javascript"]$.ajax({<br />
         type: &#8220;POST&#8221;,<br />
         url: &#8220;login.php&#8221;,<br />
         data: qry,<br />
         success: function(html) {<br />
             if(html == &#8216;good&#8217;) {<br />
                  $(&#8220;#loader&#8221;).hide();<br />
                  $(&#8220;#instantform&#8221;).fadeOut(1100, &#8216;swing&#8217;)<br />
                  $(&#8220;#instantform&#8221;).next(&#8220;p&#8221;).fadeOut(1100, function(){<br />
                      $(&#8220;#results&#8221;).append(&#8216;<br />
<h2>Success! Logged in as <strong>&#8216;+usernum+&#8217;</strong>!!&#8217;);<br />
                  });</p>
<p>                  $(&#8220;#loader &gt; img&#8221;).attr(&#8220;src&#8221;, &#8220;img/checkmark.png&#8221;);<br />
                  $(&#8220;#loader&#8221;).fadeIn(800);<br />
            }<br />
            else {<br />
                // handling errors if needed<br />
         }<br />
    }<br />
});<br />
[/cc]</p>
<p>jQuery has made things a lot simpler with a specific <a href="http://api.jquery.com/jQuery.ajax/">.ajax() method</a> and parameters to boot. I&#8217;ve setup standard values using a POST format so the data isn&#8217;t streamed as $_GET variables. If we get a successful ajax connection I&#8217;ve added a new <em>function()</em> as the callback method and passed in the response html from the login.php file.</p>
<p>The PHP backend is hard coded to display the message &#8216;good&#8217; if we have a successful login. This will activate the first clause in our if/else function which hides the loader panel and begins a .fadeOut() function on our form. Remember that all of this processing is happening with <strong>every keystroke</strong>, but we only access this functionality if the Ajax response is good (when the user provides proper credentials).</p>
<h3>Demo PHP Formatting</h3>
<p>There are a few other neat effects I&#8217;ve created with the jQuery callback function that I won&#8217;t go into further detail. They are fairly straightforward to understand if you know about jQuery selector syntax. Note when we get a failed login I haven&#8217;t added anything, just a comment to fill the void.</p>
<p>Now let&#8217;s swap over and examine the very last piece of this puzzle! In my login.php file I&#8217;ve only added the bare minimum amount of code we need to process this form. We check if there are $_POST variables set and if true assign the username and password values to <em>$u</em> and <em>$p</em>.</p>
<p>[cc lang="php"]if($_POST) {<br />
	$u = $_POST['username'];<br />
	$p = $_POST['pw'];</p>
<p>	if($u == &#8220;admin&#8221; &amp;&amp; $p == &#8220;password1&#8243;) {<br />
		echo &#8220;good&#8221;;<br />
	}</p>
<p>	else {<br />
		// possible error handling in php<br />
		// not required for all<br />
	}<br />
}<br />
[/cc]</p>
<p>I&#8217;ve done nothing fancy to check for login credentials. Just a simple if/else clause to matchup the username and password string values. Certainly not the safest method but there are <a href="http://spyrestudios.com/7-php-development-techniques-to-minimize-security-vulnerabilities/">plenty of tutorials</a> on securing PHP login data. If PHP gets a matchup we echo (or return) good to the jQuery call. Otherwise we get nothing in return.</p>
<p><a href="http://designm.ag/previews/instant-login/index.html"><img class="imgborder" src="http://designm.ag/wp-content/uploads/2011/08/instant-login-jquery-admin.jpg" alt="Demo of Instant Login Form" /></a></p>
<p style="text-align: center"><strong><a href="http://designm.ag/previews/instant-login/index.html">Live Demo</a></strong> &#8211; <strong><a href="http://designm.ag/previews/instant-login/source/instant-login-source.zip">Download Source Code</a></strong></p>
<h3>Conclusion</h3>
<p>This introductory tutorial was aimed to grow your knowledge of jQuery programming. If you understand PHP and session variables it shouldn&#8217;t take much work to port this script into a working login form. Many of the animations I&#8217;ve used are offered by default in jQuery, so you may be interested <a href="http://designm.ag/resources/jquery-form-plugins/">browsing form plugins</a> for some alternate effects.</p>
<p>Be sure to download the source code above and play around with the demo when you have time. If you launch anything live onto your own website we would love to see it! Additionally if you have questions or comments feel free to offer your ideas in the discussion area below.</p>
<br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=45492&c=943457242' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=45492&c=943457242' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></content:encoded>
			<wfw:commentRss>http://designm.ag/tutorials/coding-an-instant-login-form-with-jquery-and-phpajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached
Page Caching using memcached
Database Caching 4/37 queries in 0.019 seconds using memcached
Object Caching 1902/1986 objects using memcached

Served from: designm.ag @ 2012-02-12 10:05:46 -->
