<?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>Ian Hoar – Passion for Technology – Geeking Out &#187; Tutorials</title>
	<atom:link href="http://www.ianhoar.com/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ianhoar.com</link>
	<description>Technology, Web, Toys, Games, Design, Entertainment, Gadgets, &#38; Geeking Out</description>
	<lastBuildDate>Mon, 16 Jan 2012 03:51:52 +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>Creating subdomains and custom server names with MAMP</title>
		<link>http://www.ianhoar.com/2011/10/26/creating-subdomains-and-custom-server-names-with-mamp/</link>
		<comments>http://www.ianhoar.com/2011/10/26/creating-subdomains-and-custom-server-names-with-mamp/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 03:29:49 +0000</pubDate>
		<dc:creator>Ian Hoar</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[MAMP]]></category>
		<category><![CDATA[subdomains]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.ianhoar.com/?p=4515</guid>
		<description><![CDATA[My server of choice is Apache, but I&#8217;m no web administrator, so I use MAMP a great quick install Apache, MySQL and PHP stack. Recently I have found the need for local subdomains like dev.localhost. With a local subdomain you can more accurately simulate your live environment because you can link absolutely to the root [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-4536" title="MAMP Apache" src="http://www.ianhoar.com/wp-content/uploads/2011/10/MAMP-Apache.png" alt="MAMP Apache" width="200" height="200" />My server of choice is Apache, but I&#8217;m no web administrator, so I use <a href="http://www.mamp.info">MAMP</a> a great quick install Apache, MySQL and PHP stack. Recently I have found the need for local subdomains like <strong>dev.localhost</strong>. With a local subdomain you can more accurately simulate your live environment because you can link absolutely to the root of your server. These simple directions are specific to the MAMP configuration, but the same steps can be used on any Apache WAMP and LAMP setups with the exception of the location of the configuration file, so lets get started.</p>
<p><span id="more-4515"></span>Open the finder and go to:</p>
<p><strong>Applications/MAMP/conf/apache/</strong></p>
<p>The file you want to edit is <strong>httpd.conf</strong>, if you are not using MAMP you can search for this file and then follow the directions below.</p>
<p>Open the httpd.conf in the editor of your choice. Once you have it open search for &#8220;<strong>Listen 80</strong>&#8220;. Paste the example below into your config being careful to either paste over Listen 80 or do not copy the Listen 80 part from the example below. These directions are assuming a default MAMP httpd.conf. Replace <strong>username</strong> with your own username.</p>
<pre class="brush: bash; title: ; notranslate">
Listen 80

NameVirtualHost *
&lt;VirtualHost *&gt;
ServerName dev.localhost
DocumentRoot /Users/username/Sites/dev
&lt;Directory /&gt;
Options FollowSymLinks
AllowOverride None
&lt;/Directory&gt;
&lt;Directory /Users/username/Sites/dev&gt;
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
&lt;/Directory&gt;
&lt;/VirtualHost&gt;

&lt;VirtualHost *&gt;
ServerName coolsite
DocumentRoot /Users/username/Sites/coolsite
&lt;Directory /&gt;
Options FollowSymLinks
AllowOverride None
&lt;/Directory&gt;
&lt;Directory /Users/username/Sites/coolsite&gt;
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
&lt;/Directory&gt;
&lt;/VirtualHost&gt;

&lt;VirtualHost *&gt;
ServerName localhost
DocumentRoot /Users/username/Sites/
&lt;Directory /&gt;
Options FollowSymLinks
AllowOverride None
&lt;/Directory&gt;
&lt;Directory /Users/username/Sites/&gt;
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
&lt;/Directory&gt;
&lt;/VirtualHost&gt;
</pre>
<p>So what we have here is three different server names and paths. You can use subdomains like <strong>dev.localhost</strong> or you can even use a full name like <strong>coolsite</strong>. The reason we specify <strong>localhost</strong> and point it to the root of the sites folder is so localhost still works properly when you type it in the browser.</p>
<p>There is one step left. Open the terminal from your <strong>Applications/Utilities</strong> directory in the finder or search for it in spotlight. You will need to edit your <strong>hosts file</strong>, I use the VI editor, but if you haven&#8217;t used VI before, I recommend using Nano instead.</p>
<p>Type one of the following into the terminal.</p>
<pre class="brush: bash; title: ; notranslate">
$ sudo vi /private/etc/hosts
</pre>
<p>or</p>
<pre class="brush: bash; title: ; notranslate">
$ sudo nano /private/etc/hosts
</pre>
<p>The <strong>sudo</strong> will prompt you for your password, enter it and the file should open. If you don&#8217;t use sudo and enter your password you will not be able to save your changes. You should now see your host file, look for the line <strong>127.0.0.1 localhost</strong>. Enter the info below being careful not to change anything else in your hosts file, it may be empty or it could have something other programs or people have put in there.</p>
<pre class="brush: bash; title: ; notranslate">
127.0.0.1 localhost
127.0.0.1 dev.localhost
127.0.0.1 coolsite
</pre>
<p>As you can see these correspond with the names you entered in the httpd.conf file. Now you will need to stop and start your server via MAMP or command line. Once you have stopped and started the MAMP stack, your new server names should load when typed into the browser. This is a great way for testing your sites and in some cases may be the only way to test them. You can use any names you wish and setup as many server names as you wish.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ianhoar.com/2011/10/26/creating-subdomains-and-custom-server-names-with-mamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery: How to get links to work in toggled or dynamic content</title>
		<link>http://www.ianhoar.com/2011/09/09/jquery-how-to-get-links-to-work-in-toggled-or-dynamic-content/</link>
		<comments>http://www.ianhoar.com/2011/09/09/jquery-how-to-get-links-to-work-in-toggled-or-dynamic-content/#comments</comments>
		<pubDate>Sat, 10 Sep 2011 01:03:36 +0000</pubDate>
		<dc:creator>Ian Hoar</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[stopPropagation]]></category>
		<category><![CDATA[toggle]]></category>

		<guid isPermaLink="false">http://www.ianhoar.com/?p=4473</guid>
		<description><![CDATA[jQuery still never ceases to amaze me. The developers of this fantastic library seem to have thought of everything, and the only real challenge for us end users is hunting through the API. Recently I was tasked with creating slide out toggle boxes that had links embedded within them. The problem was that the animation [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-4409" title="jQuery" src="http://www.ianhoar.com/wp-content/uploads/2011/06/jquery_logo.png" alt="jQuery" width="200" height="193" />jQuery still never ceases to amaze me. The developers of this fantastic library seem to have thought of everything, and the only real challenge for us end users is hunting through the API. Recently I was tasked with creating slide out toggle boxes that had links embedded within them. The problem was that the animation would be triggered before the links, thus rending them useless. Luckily like many things with jQuery the fix is simple and I will demonstrate with two examples.</p>
<p><span id="more-4473"></span></p>
<h2>The problem</h2>
<pre class="brush: jscript; title: ; notranslate">

$jQuery('#toggle-test').toggle(function() {
  $jQuery(this).stop(true, true).animate({width : 500});
}, function() {
  $jQuery(this).stop(true, true).animate({width : 300});
});
</pre>
<div id="toggle-test">Here is a block of content <a href="http://www.ianhoar.com">with an inline link</a> that is a fully toggleable div element, but the link does not actually work.</div>
<p>As you can see in the example above, when clicking the link the toggle animation is triggered instead of the link destination.</p>
<h2>The solution</h2>
<pre class="brush: jscript; title: ; notranslate">
$jQuery('#toggle-test2').toggle(function() {
  $jQuery(&quot;a&quot;).click(function(e) {
    e.stopPropagation();
  });
  $jQuery(this).stop(true, true).animate({width : 500});
}, function() {
  $jQuery(this).stop(true, true).animate({width : 300});
});
</pre>
<div id="toggle-test2">Here is a block of content <a href="http://www.ianhoar.com">with an inline link</a> that is a fully toggleable div element and a working link.</div>
<p>The difference with the second example is that we have added a click event within the toggle and added the <a href="http://api.jquery.com/event.stopPropagation/"><strong>stopPropagation()</strong> method</a>. This &#8220;Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event&#8221; thus allowing the link to take it&#8217;s normal course of action.</p>
<p>A more practical use of this would be clickable slide out boxes with links embedded or even a close button on a toggleable element. These are just some of the uses for <strong>stopPropagation()</strong>, so keep it handy in your arsenal of jQuery tools.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ianhoar.com/2011/09/09/jquery-how-to-get-links-to-work-in-toggled-or-dynamic-content/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery and Fancybox: How to automatically set the height of an iframe lightbox</title>
		<link>http://www.ianhoar.com/2011/08/25/jquery-and-fancybox-how-to-automatically-set-the-height-of-an-iframe-lightbox/</link>
		<comments>http://www.ianhoar.com/2011/08/25/jquery-and-fancybox-how-to-automatically-set-the-height-of-an-iframe-lightbox/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 00:34:32 +0000</pubDate>
		<dc:creator>Ian Hoar</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Fancybox]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[lightbox]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.ianhoar.com/?p=4487</guid>
		<description><![CDATA[Fancybox is a pretty cool lightbox plugin for jQuery that I have been using for awhile now. It&#8217;s got a great feature set, looks good, and for the most part it just works out of the box. There is however one thing that was mind numbingly hard to figure out, and that was how to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://fancybox.net/"><img class="alignleft size-full wp-image-4409" title="jQuery" src="http://www.ianhoar.com/wp-content/uploads/2011/06/jquery_logo.png" alt="jQuery" width="200" height="193" />Fancybox</a> is a pretty cool lightbox plugin for jQuery that I have been using for awhile now. It&#8217;s got a great feature set, looks good, and for the most part it just works out of the box. There is however one thing that was mind numbingly hard to figure out, and that was how to automatically set the height of an iframe lightbox. Fancybox has this functionality built in for inline content via the autoDimensions key, which is set to true by default. Unfortunately this is not the case for iframes. After some hair pulling I managed to piece together an auto height solution for Fancybox iframes, but this technique could also be used without Fancybox to find the height of any iframe.</p>
<p><span id="more-4487"></span>Like most web challenges, the fix is quite simple, but almost every example I found always seemed to be missing one important piece of the puzzle.</p>
<pre class="brush: jscript; title: ; notranslate">
$(&quot;#lightbox&quot;).fancybox({
  'hideOnContentClick' : true,
  'width' : 500,
  'type' : 'iframe',
  'padding' : 35,
  'onComplete' : function() {
    $('#fancybox-frame').load(function() { // wait for frame to load and then gets it's height
      $('#fancybox-content').height($(this).contents().find('body').height()+30);
    });
  }
});
</pre>
<p>In the above example we have given our lightbox an id of #lightbox. We initialize the plugin with some options and give it a type option of iframe. Now you can create your separate HTML file for the lightbox and link to it form your main page and give the link href an id of #fancy-box. If you would like to use multiple lightboxes on one page you could use a class instead of an id.</p>
<p>The iframe height magic happens when the <strong>onComplete</strong> event is triggered. Here you can set up a call call jQuery&#8217;s <strong>load</strong> function which will then be used to call the height function after the iframe has loaded—you cannot get the height until the frame source has fully loaded. The id of #fancybox-content is the name of the div that Fancybox wraps the iframe in. We then set the <strong>height</strong> of that div by checking the <strong>contents</strong> of the iframe and using jQuery&#8217;s <strong>find</strong> method to locate the body tag and then get the <strong>height</strong>. I found that the height was always off by about 30 pixels, thus the +30. This may be due to paddings and margins within the loaded HTML file, but you can fiddle around with it until you get the right offset. You should now have an iframed lightbox that auto sizes its height.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ianhoar.com/2011/08/25/jquery-and-fancybox-how-to-automatically-set-the-height-of-an-iframe-lightbox/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Google Maps api and iPad/iPhone zoom and scale issues when orientation is changed</title>
		<link>http://www.ianhoar.com/2011/07/12/google-maps-api-and-ipadiphone-zoom-and-scale-issues-when-orientation-is-changed/</link>
		<comments>http://www.ianhoar.com/2011/07/12/google-maps-api-and-ipadiphone-zoom-and-scale-issues-when-orientation-is-changed/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 03:48:08 +0000</pubDate>
		<dc:creator>Ian Hoar</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Smartphones]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[metadata]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.ianhoar.com/?p=4475</guid>
		<description><![CDATA[I recently bought an iPad and I&#8217;m absolutely loving it. It also happened to coincide with an exciting project that I&#8217;m working on that requires the Google maps API to work on an iPad. The project required a full screen map, but when switching from landscape to portrait or vice versa the zoom level would [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1866" title="Apple Logo" src="http://www.ianhoar.com/wp-content/uploads/2008/09/apple_chrome_logo.png" alt="Apple Logo" width="200" height="245" />I recently bought an iPad and I&#8217;m absolutely loving it. It also happened to coincide with an exciting project that I&#8217;m working on that requires the Google maps API to work on an iPad. The project required a full screen map, but when switching from landscape to portrait or vice versa the zoom level would be off. The Google maps controls would also be off the page, page graphics were also blurry due to being zoomed, even the Google Map itself was blurry. After much tweaking, fiddling and scratching my head, the fix turned out to be quite simple to fix.</p>
<p><span id="more-4475"></span>This quick tutorial will not go into the details of how to use the Google maps API, for that I refer you to the <a href="http://code.google.com/apis/maps/documentation/javascript/tutorial.html">starter tutorial</a> which is missing the fix needed to make the maps display properly in the iPad. This issue also affects the iPhone and should fix any problems there too. After thinking it was a CSS issue and fiddling with the CSS for over an hour I stumbled across more metadata options. In the Google example linked above, it shows a metadata name attribute of  &#8220;viewport&#8221; with content attribute values of &#8220;initial-scale=1.0, user-scalable=no&#8221;. You need a bit more than this for the iPad and iPhone. See below.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no&quot; /&gt;
</pre>
<p>The most important value is <strong>maximum-scale=1.0</strong><strong></strong>, <strong></strong><strong>width=device-width</strong> is just in there for good measure.  Basically this stops Safari from scaling or zooming your viewport when the orientation is changed. One note, sometimes the Safari browser won&#8217;t forget the way it was displaying before you made your changes, a quick stop in <strong>options -&gt; Safari</strong> and you will find a clear cache option.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ianhoar.com/2011/07/12/google-maps-api-and-ipadiphone-zoom-and-scale-issues-when-orientation-is-changed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clearing the jQuery animation queue</title>
		<link>http://www.ianhoar.com/2011/06/05/clearing-the-jquery-animation-queue/</link>
		<comments>http://www.ianhoar.com/2011/06/05/clearing-the-jquery-animation-queue/#comments</comments>
		<pubDate>Sun, 05 Jun 2011 05:45:39 +0000</pubDate>
		<dc:creator>Ian Hoar</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.ianhoar.com/?p=4220</guid>
		<description><![CDATA[Ever see sites where a jQuery animation happens over and over when you rollover or click it multiple times. It&#8217;s almost as if the animations are stacking on top of one another in a queue and executing one by one, and guess what? That&#8217;s exactly what&#8217;s happening. Not to worry though, there is a simple [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-4409" title="jQuery" src="http://www.ianhoar.com/wp-content/uploads/2011/06/jquery_logo.png" alt="jQuery" width="200" height="193" />Ever see sites where a jQuery animation happens over and over when you rollover or click it multiple times. It&#8217;s almost as if the animations are stacking on top of one another in a queue and executing one by one, and guess what? That&#8217;s exactly what&#8217;s happening. Not to worry though, there is a simple and easy way to fix this.</p>
<p><span id="more-4220"></span></p>
<p>Below we have four examples, two jQuery toggles and two jQuery hovers. The first toggle and the first hover do not employ the <strong>stop()</strong> function while the proceeding ones do. Try them out for yourself.</p>
<h2>4 examples</h2>
<div id="examples">
<div id="example1">click with no stop</div>
<div id="example2">click with stop</div>
<div id="example3">hover with no stop</div>
<div id="example4">hover with stop</div>
</div>
<h2>No stop() function used</h2>
<pre class="brush: jscript; title: ; notranslate">
var height = $('#example1').height();
$('#example1').toggle(function() {
     $(this).animate({'height' : '100px'}, 'slow');
},
function() {
     $(this).animate({'height' : height}, 'slow');
});

$('#example3').hover(function() {
     $(this).animate({'height' : '100px'}, 'slow');
},
function() {
     $(this).animate({'height' : height}, 'slow');
});
</pre>
<p>The above examples first get the height of the example1 id, this height is then used for resetting all the examples to their original height after the first animation.</p>
<p>The snippet then sets the height the <strong>#example1</strong> element to 100px when toggled/clicked and then back to the original height when toggled again. The same logic is applied to <strong>#example3</strong> only with a hover instead.  If you rapidly click the first and third examples above you will see the animations queue up and continue repeating until finished. It is more noticeable with rollovers, and this is probably not a desirable behavior in most situations.</p>
<h2>Examples 2 and 4 use the jQuery stop function</h2>
<pre class="brush: jscript; title: ; notranslate">
$('#example2').toggle(function() {
     $(this).stop(true, true).animate({'height' : '100px'}, 'slow');
},
function() {
     $(this).stop(true, true).animate({'height' : height}, 'slow');
});
$('#example4').hover(function() {
     $(this).stop(true, false).animate({'height' : '100px'}, 'slow');
},
function() {
     $(this).stop(true, true).animate({'height' : height}, 'slow');
});
</pre>
<p>As you can see it&#8217;s pretty simple to fix, but you also have to be careful with the <strong>stop()</strong> function as sometimes you can get undesirable flicker effects.</p>
<h2>Understanding the stop() function</h2>
<p>The stop function takes two Boolean values, both of which default to false.</p>
<p><strong>.stop( [ clearQueue ], [ jumpToEnd ] )</strong></p>
<p>The first value <strong>clearQueue</strong> will stop the animation from stacking or queuing up each animation. The <strong>jumpToEnd</strong> value tells whether to finish or jump to the end of the animation sequence. You will often need to play around with these values to see what works best. As you can see in the hover example, the mouse over clears the queue but continues to animate, while the mouse out clears the queue and jumps to the end of the animation. If these values are all left to true in this example you can get some flickering effects.</p>
<p>Remember that the jQuery <strong>stop()</strong> function can be used on any animation function, which includes functions like <strong>slideUp()</strong> and <strong>SlideDown()</strong>. Happy coding.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ianhoar.com/2011/06/05/clearing-the-jquery-animation-queue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3 easy methods to create dotted or dashed lines in Photoshop</title>
		<link>http://www.ianhoar.com/2011/05/28/3-easy-methods-to-create-dotted-or-dashed-lines-in-photoshop/</link>
		<comments>http://www.ianhoar.com/2011/05/28/3-easy-methods-to-create-dotted-or-dashed-lines-in-photoshop/#comments</comments>
		<pubDate>Sun, 29 May 2011 03:56:58 +0000</pubDate>
		<dc:creator>Ian Hoar</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.ianhoar.com/?p=4346</guid>
		<description><![CDATA[Dotted or dashed lines can be a great design element and easy to achieve with a bit of CSS, but creating a lot of them in Photoshop mockups can be time consuming and frustrating. There are 3 simple ways to create dotted or dashed lines in Photoshop. The first one is the way a lot [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-4381" title="Photoshop" src="http://www.ianhoar.com/wp-content/uploads/2011/05/ps5_logo.png" alt="Photoshop" width="200" height="200" />Dotted or dashed lines can be a great design element and easy to achieve with a bit of CSS, but creating a lot of them in Photoshop mockups can be time consuming and frustrating. There are 3 simple ways to create dotted or dashed lines in Photoshop. The first one is the way a lot of people probably do it and that&#8217;s by doing it with the pencil tool dot by dot and then duplicating the layer. This is slow but there are ways to speed up the process. The 2nd method is achieved by using the brush palette spacing settings. The 3rd method is uses custom patterns. This tutorial will cover all three methods with the Mac/Windows shortcut keys needed to speed up the process.</p>
<p><span id="more-4346"></span></p>
<h2>Method 1: Dot by dot</h2>
<p>The dot by dot method is exactly as it sounds, grab a brush and draw your line out. Depending on your layout this could take forever and end up being less than perfect if you make a mistake. A quick way to speed up the process is by duplicating and merging the layers as you go.</p>
<p>Start with a blank canvas of 500&#215;500 pixels. Go to your layers window and <strong>create a new layer</strong>. Now zoom in about 500% and create two horizontal dashes or dots with the pen tool (<strong> b </strong>). Once you have completed this switch to the move tool (<strong>v</strong>). Now drag your two dots while holding down the (<strong> alt </strong>) key, this will turn your move tool into a double arrow which means you are duplicating the layer. As you drag the layer line it up so the spacing is correct with the previous two dots. You should now have 4 dots/dashes. Once you have lined them up merge them ( <strong>command/control e</strong> ). Now repeat the whole process again, each time you will double the length of your dotted/dashed line. If you use this method, although clunky, you can created many lines very quickly and then trim them to your desired size with the marquee tool. If you need a vertical line all you have to do is rotate (<strong> command/control t</strong> ) the layer while holding the ( <strong>shift ) </strong>key to get a perfectly straight vertical line.</p>
<p><img class="alignleft size-full wp-image-4364" title="Layers Palette" src="http://www.ianhoar.com/wp-content/uploads/2011/05/layers_palette.png" alt="Layers Palette" width="223" height="198" />Need to change the colour? No problem, select the dashed/dotted lines layer in your layers palette and <strong>click &#8220;Lock transparent pixels&#8221;</strong>. Now select your brush tool (<strong> b </strong>) and increase the size ( <strong>] </strong>) to a large enough brush to paint over the dots/dashes quickly. Select the colour you wish to use and scribble over top of your lines.</p>
<p>This method while not overly eloquent is often the easiest method for a quick dashed line. If you need to use many dotted/dashed lines you might want to look at one of the other methods below.</p>
<h2>Method 2: Brush palette</h2>
<p><img class="size-full wp-image-4367 alignright" title="Brushes" src="http://www.ianhoar.com/wp-content/uploads/2011/05/brushes.png" alt="Brushes" width="376" height="460" />The brush method is fairly fast. Create a new 500&#215;500 pixel canvas. Open your brushes ( <strong>F5</strong> ) palette and select the 1 px brush. Uncheck <strong>Shape Dynamices</strong>, then select <strong>Brush Tip Shape</strong>. Slide the <strong>Spacing</strong> slider to the far right and then hold <strong>shift</strong> while drawing a line. You should have a perfect dotted line.</p>
<p>You can mess around with the spacing and roundness options, but there is only so much you can do with the default brushes, if you use rounded brushes are will get rounded dots, which may or may not be what you want. If you need larger dashes you can create your own brush. Say you want a 10&#215;8 dash, all you have to do is created a 10&#215;8 square dash and crop the canvas to that size. A quick way is to trim the document in the image menu. (<strong> Image -&gt; Trim&#8230; and select ok </strong>).</p>
<p>Once you have your brush ready go to the edit menu and define a brush. ( <strong>Edit -&gt; Define Brush Preset&#8230;</strong> ). Name it can click ok. When you return to the brushes menu it should be selected. Now if you apply the spacing settings to this brush you should have a much thicker dashed line.</p>
<p>The brush method is probably one of the most robust methods for creating dotted/dashed lines in photoshop.</p>
<h2>Method 3: Pattern palette</h2>
<p>The pattern method is similar in some ways to the brush method. This is by far the most complex of the 3 methods, but if you plan on changing the size of dotted boxes a lot then this method is the most flexible. When I create Photoshop mockups for web, I use a lot of layer shapes for sidebars, boxes, headers and what not and constantly nudge them into place with the arrow keys and the direct selection tool. With this method you will apply a pattern via the styles to a shape layer and then work with the vector mask to only show the edges of the pattern. Once completed you will now have a dotted or dashed line that you can move and nudge with the direct selection tool as much as you like without ever worrying about recreating the dotted lines again.</p>
<p><img class="alignleft size-full wp-image-4371" title="2x2 pixels" src="http://www.ianhoar.com/wp-content/uploads/2011/05/2x2.png" alt="2x2 pixels" width="339" height="358" />For this example we will create a 1 pixel dotted line, but this will work with thicker lines too. Create a new 2&#215;2 document, add a new layer to it and hide the background layer so the image is completely transparent. Now put one pixel in the top left corner. Your document should look like the zoomed in example to the left. If you were to create a 3 pixel dash, your document would be 6&#215;6 with a 3 pixel black box in the top left corner.</p>
<p>Now go to the edit menu and define a pattern. ( <strong>Edit -&gt; Define Pattern&#8230;</strong> ). You are ready to create your box shape now. Create a large new document ( <strong>command/control N</strong> ) to play around with. Select the rectangle tool ( <strong>u</strong> ) and create a rectangular shape.</p>
<p>Now <img class="alignright size-full wp-image-4373" title="Layers Palette" src="http://www.ianhoar.com/wp-content/uploads/2011/05/layers_palette21.png" alt="Layers Palette" width="222" height="192" />select the newly created shape and reduce it&#8217;s fill to 0%. The difference between Opacity and Fill is that Fill will hide the shape but not the Blending Options that you will be applying next. You can leave this a solid colour too, but make sure it&#8217;s not the same colour as your pattern, otherwise you will not see the dotted line. Now right click your new shape layer and select <strong>Blending Options&#8230;</strong></p>
<p>In the blending options click <strong>Pattern Overlay</strong> and then select your pattern in the <strong>Pattern: </strong> section. Your pattern should be the last one added. Click <strong>OK</strong>.</p>
<p><img class="aligncenter size-full wp-image-4374" title="Blending Options" src="http://www.ianhoar.com/wp-content/uploads/2011/05/blending_options.png" alt="Blending Options" width="596" height="455" /></p>
<p>Now you should have a box full of 1 pixel dots. Select the shape tool again ( <strong>u</strong> ) and make sure <strong>Shape layers</strong> and <strong>Subtract from shape area</strong> are selected in the toolbar as shown below.</p>
<p><img class="aligncenter size-full wp-image-4378" title="Toolbar" src="http://www.ianhoar.com/wp-content/uploads/2011/05/toolbar.png" alt="Toolbar" width="406" height="52" /></p>
<p><img class="alignleft size-full wp-image-4377" title="Layers Palette" src="http://www.ianhoar.com/wp-content/uploads/2011/05/layers_palette3.png" alt="Layers Palette" width="221" height="144" />Now select the <strong>Vector mask</strong> of  your shape in the layers palette and draw a mask over your shape. The key here is to draw it right to the edges. You can use the <strong>Direct Selection Tool </strong>( <strong>a </strong>) to tweak your anchor points.</p>
<p><img class="alignright size-full wp-image-4380" title="Dotted Box" src="http://www.ianhoar.com/wp-content/uploads/2011/05/box.png" alt="Dotted Box" width="107" height="105" />You should now have a nice box with dotted lines like the one to the right.  You can continue to use the Direct Selection Tool by selecting the entire edge of the shape to manipulate this rectangle without worrying about the borders again. If you wanted the border only on one side then you would manipulate the inner vector mask so that it covered the top, right and bottom sides of the rectangle.</p>
<p>Although this method is more time consuming than the first two, it&#8217;s also very powerful if you are going to have a lot of dotted or dashed boxes in several layouts. Now you can just duplicate this one over and over and resize it without worrying about re-drawing the dots/dashes. As mentioned this can also be used for straight lines, just make sure the other sides of the rectangle are masked. Remember that the pattern is the colour of your border, so if you want a different colour you need to change the pattern colour.</p>
<p>If you have other tips on how to achieve the same examples as above with different methods, I would love to hear about them in the comments below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ianhoar.com/2011/05/28/3-easy-methods-to-create-dotted-or-dashed-lines-in-photoshop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using custom CSS and Javascript in WordPress posts</title>
		<link>http://www.ianhoar.com/2011/04/02/using-custom-css-and-javascript-in-wordpress-posts/</link>
		<comments>http://www.ianhoar.com/2011/04/02/using-custom-css-and-javascript-in-wordpress-posts/#comments</comments>
		<pubDate>Sun, 03 Apr 2011 00:46:07 +0000</pubDate>
		<dc:creator>Ian Hoar</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.ianhoar.com/?p=4279</guid>
		<description><![CDATA[Today while writing The secrets to using custom web fonts I ran into a bit of a snag. I wanted to show several CSS driven examples within the post, but the WordPress editor would remove anything I added. I have dealt with this issue in the past, usually in a clunky manner or even hosted [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-4312" title="Using custom CSS and Javascript in WordPress posts" src="http://www.ianhoar.com/wp-content/uploads/2011/04/tools.png" alt="Using custom CSS and Javascript in WordPress posts" width="200" height="147" />Today while writing <a href="http://www.ianhoar.com/2011/04/02/the-secrets-to-using-custom-web-fonts/">The secrets to using custom web fonts</a> I ran into a bit of a snag. I wanted to show several CSS driven examples within the post, but the WordPress editor would remove anything I added. I have dealt with this issue in the past, usually in a clunky manner or even hosted separate example pages. This time though I really wanted the font examples to show up within the actual page content and I didn&#8217;t want to add more styles to my WordPress theme. The method I used is remarkably easy and can be implemented in about two or three minutes.</p>
<p><span id="more-4279"></span></p>
<p>For custom CSS and JavaScript within the post, the best place to put these snippets is embedded right into the HTML head of that post. This is super easy to do with WordPress custom fields and a slight modification to your WordPress theme.</p>
<h2>What are custom fields?</h2>
<p><img class="alignright size-full wp-image-4315" title="Custom Field Screen Options" src="http://www.ianhoar.com/wp-content/uploads/2011/04/custom_field_screen_options.png" alt="Custom Field Screen Options" width="257" height="184" />If you don&#8217;t know what custom fields are in WordPress then step aboard, they are another powerful tool to add to your arsenal and easy to understand. The first step is making sure they are displayed on your <strong>Edit Post</strong> admin page. Create a new post and look to the top right corner of you admin interface. You should see <strong>Screen Options</strong>. Click it and then make sure <strong>Custom Fields</strong> is ticked in the <strong>Show on screen</strong> check box options. Now if you look below your post you should see a panel called Custom Fields.</p>
<h2>A quick update to your theme</h2>
<p>Either download your header.php file or use the WordPress editor to paste the snippet of code below into it. The snippet below should go right before your closing <strong>&lt;/head&gt;</strong> tag.</p>
<pre class="brush: php; title: ; notranslate">&lt;?php
if (is_single()) {
     if ($custom_header = get_post_meta($post-&gt;ID, 'custom_header', true)) {
     echo $custom_header;
     }
}
?&gt;</pre>
<p>This example allows you to post any type of data into your page head and allows you to specify the type of tag such as <strong>link style</strong> or <strong>script</strong>. The code above says: is this a single page? If so get the custom field named <strong>custom_header</strong> and echo/print it out. Now you are done and can save/upload the file to your server.</p>
<p>Now in your custom fields panel enter a new custom field of custom_header and add the styles or JavaScript you need. In the example below you would then add .myCustomStyle to your post in the HTML tab. I find using <strong>span</strong> tags in the editor is the best way to add custom classes.</p>
<p><img class="size-full wp-image-4308 aligncenter" title="Custom Fields" src="http://www.ianhoar.com/wp-content/uploads/2011/04/custom_fields.png" alt="Custom Fields" width="681" height="344" /></p>
<p>You can add any kind of custom code into the header using the same method. Read more about <a href="http://codex.wordpress.org/Using_Custom_Fields">custom fields</a> in the <a href="http://codex.wordpress.org/Using_Custom_Fields">WordPress codex</a>.</p>
<h2>My custom CSS isn&#8217;t showing up</h2>
<p>If your CSS classes seem to be having no affect it&#8217;s probably because they are being overridden by your own theme CSS. Adding the <strong>!important</strong> declaration to any problem styles will fix this issue forcing them to override the style that is overriding your custom style, see the example below.</p>
<pre class="brush: css; title: ; notranslate">font-size:20px !important;
color:#1f1f1f !important;
</pre>
<p>That&#8217;s all there is to it, happy coding.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ianhoar.com/2011/04/02/using-custom-css-and-javascript-in-wordpress-posts/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The secrets to using custom web fonts</title>
		<link>http://www.ianhoar.com/2011/04/02/the-secrets-to-using-custom-web-fonts/</link>
		<comments>http://www.ianhoar.com/2011/04/02/the-secrets-to-using-custom-web-fonts/#comments</comments>
		<pubDate>Sat, 02 Apr 2011 23:03:00 +0000</pubDate>
		<dc:creator>Ian Hoar</dc:creator>
				<category><![CDATA[Freebies]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[@font-face]]></category>
		<category><![CDATA[cufon]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.ianhoar.com/?p=4269</guid>
		<description><![CDATA[If you are a web designer then you&#8217;re already fully aware of the limitations surrounding the usage of fonts on the web. For years we have basically had two reliable options, use a standard web based font that is included on most operating systems with a few fall back fonts, or images. For headlines, custom [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-4301" title="The secrets to using custom web fonts" src="http://www.ianhoar.com/wp-content/uploads/2011/04/fonts.png" alt="The secrets to using custom web fonts" width="200" height="150" />If you are a web designer then you&#8217;re already fully aware of the limitations surrounding the usage of fonts on the web. For years we have basically had two reliable options, use a standard web based font that is included on most operating systems with a few fall back fonts, or images. For headlines, custom fonts and anything fancy images were the only way to go, but that&#8217;s all about to change.</p>
<p><span id="more-4269"></span></p>
<p><span class="pacifico" style="color: #2d6fb4;">Start using awesome custom web fonts today!</span></p>
<h2>A quick recap</h2>
<p>Several older embedding options exist that have been around for awhile. Scalable Inman Flash Replacement (sIFR) which requires the Flash plugin and is thus in my opinion less desirable option, is one of them. There are also server side font replacement implementations where graphics are generated and then served to the web browser, but again this requires multiple technologies to work and has many limitations.</p>
<h2>Cufón, a Javascript solution</h2>
<p>A more recent technology advance in fonts is <a href="http://cufon.shoqolate.com/generate/">Cufón</a>. Cufón requires no flash install and no extra software on the server side. It&#8217;s a pure JavaScript implementation and converts fonts into inline graphics. To a screen reader or web crawler the text looks like plain HTML text as you apply Cufón to the HTML text elements you wish to replace. This is one of the best font implementations yet, but it still has several limitations and caveats.</p>
<ol>
<li>You cannot select or copy any of the text that has been replaced with Cufón. This is minor, but still a usability issue since the user expects to be able to copy and paste text if they want.</li>
<li>You cannot user your browsers page search for Cufón replaced text.</li>
<li>Cufón does not support rollovers, so you cannot apply a hover to your links. This is a little more of a deal breaker since many navigation toolbars require rollovers.</li>
<li>It is illegal to embed many fonts with Cufón since you are distributing the actual font data in a javascript file. This is not an issue with Flash since the actual font data is not being distributed. Cufón can encrypt the font data, but you will still be in violation of many font license agreements.</li>
<li>Knowing which fonts you can legally embed is a bit of a nightmare since the legal jargon on many font foundries will just leave you confused.</li>
<li>You must upload your fonts to the <a href="http://cufon.shoqolate.com/generate/">Cufón site</a> and generate a JavaScript version of your font. This is time consuming and one extra step.</li>
</ol>
<h2 class="google">Welcome to Google web fonts</h2>
<p>Google web fonts solves five of the six issues listed above.</p>
<ol>
<li>You can select and copy / paste any of the fonts.</li>
<li>You can search for the fonts with your browsers page search.</li>
<li>Hover link rollovers are fully supported.</li>
<li>All of the fonts in Google web fonts are free to use and eliminate the research or guesswork needed.</li>
<li>Once you choose the font you would like all you have to do is copy and paste the generated code into your HTML document.</li>
</ol>
<p>The fonts are CSS based, and the concept of CSS linked fonts has been around since 1998, but it hasn&#8217;t been until recently that you could guarantee most users would have browsers that could see these linked fonts.</p>
<h2>Why Google Fonts? It&#8217;s fast and super easy!</h2>
<p>Go to <a href="http://www.google.com/webfonts">Google web fonts</a> and browse the many fonts until you find one you like. Select it and launch the Google font previewer, here you can tweak the font and even add CSS text shadows. At the bottom of your previewer you will see a CSS snippet. Copy that and past it into your style sheet and you&#8217;re done, all your fonts will be like the one in the previewer.</p>
<p><img title="Google Font Previewer" src="http://www.ianhoar.com/wp-content/uploads/2011/04/google_font_previewer-710x524.png" alt="Google Font Previewer" width="710" height="524" /></p>
<p>Of course you probably don&#8217;t want to apply it to your entire site. In the case above it would probably be best to apply the style only to HTML header tags, so you could change the <strong>body</strong> tag to <strong>h1</strong> or even use a class. For the example below I just created a <strong>google</strong> class.</p>
<p><span class="google" style="color: #2d6fb4; font-size: 18px; text-shadow: 2px 2px 2px #aaa !important;">Josefin Sans is just one of the many great fonts available at Google web fonts.</span></p>
<pre class="brush: css; title: ; notranslate">
&lt;link href=&quot;http://fonts.googleapis.com/css?family=Josefin+Sans:100,100italic,300,300italic,400,400italic,600,600italic,700,700italic&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;style type=&quot;text/css&quot;&gt;
.google {
     font-family: 'Josefin Sans', serif;
     font-size: 36px;
     font-style: normal;
     font-weight: 400;
     text-shadow: none;
     text-decoration: none;
     text-transform: none;
     letter-spacing: 0em;
     word-spacing: 0em;
     line-height: 1.2;
}
&lt;/style&gt;
</pre>
<p>And that&#8217;s about all there is to using Google fonts, it&#8217;s quick and easy.</p>
<h2>What platforms does Google fonts support?</h2>
<p>Going forward pretty much everything is going to support CSS based fonts, but here are the versions that support Googles method.</p>
<ul>
<li>Google Chrome: version 4.249.4+</li>
<li>Mozilla Firefox: version: 3.5+</li>
<li>Apple Safari: version 3.1+</li>
<li>Opera: version 10.5+</li>
<li>Microsoft Internet Explorer: version 6+</li>
</ul>
<h2>Can I download them and use them in a graphic applications like Photoshop?</h2>
<p>Yes, while you don&#8217;t need to actually download them in order to use them on a website, you can download all of the Google Web Fonts if you like and use them in your favourite graphics package.</p>
<h2>@font-face; another great method for using custom fonts</h2>
<p>You can use download <a href="http://www.google.com/webfonts">Google web fonts</a>, <a href="http://www.theleagueofmoveabletype.com/">The League of Movable Type fonts</a>, or any web licensed fonts and use the @font-face method. In fact this is a very viable method now that most browsers support. OTF fonts will be supported in all the browsers that Google Web fonts are supported in, and in some cases all the way back to IE4. The only real difference with Google Web fonts is the ease of use and convenient library, but feel free to download any fonts you want and use this method if you prefer. @font-face also has all the same benefits that were listed for Google web fonts.</p>
<h2>How to use @font-face</h2>
<p>Using css linked fonts is pretty easy and has been around since 1998. Today most browsers support them, so go nuts. First download a the font you like, it must be web licensed so grab one from <a href="http://www.google.com/webfonts">Google web fonts</a> or <a href="http://www.theleagueofmoveabletype.com/">The League of Movable Type</a>. Once you have done that you will need to upload the actual font to your web server.</p>
<p><span class="orbitron-black"><span style="font-size: 30px;">ORBITRON</span> A <span style="font-size: 35px;">high impact</span> <span style="font-size: 25px;">font</span> with four <span style="font-size: 30px;">4</span> styles from <span style="font-size: 30px;">The League of Movable Type</span>.</span></p>
<p><span class="orbitron-black">ORBITRON black.</span></p>
<p><span class="orbitron-bold">ORBITRON bold. </span></p>
<p><span class="orbitron-medium">ORBITRON medium.</span></p>
<p><span class="orbitron-light">ORBITRON light.</span></p>
<p>The CSS for above example although long is quite simple. <strong>@font-face</strong> declares your <strong>font-family</strong> name and <strong>src</strong> (source) path to where the font is located on your server. Once they are set up you can start creating css classes or styling any HTML elements as you normally would. The example above is shown below.</p>
<pre class="brush: css; title: ; notranslate">
@font-face {
     font-family: &quot;Orbitron-Black&quot;;
     src: url(&quot;PATH_TO_FONT/orbitron-black.otf&quot;);
}
@font-face {
     font-family: &quot;Orbitron-Bold&quot;;
     src: url(&quot;PATH_TO_FONT/orbitron-bold.otf&quot;);
}
@font-face {
     font-family: &quot;Orbitron-Medium&quot;;
     src: url(&quot;PATH_TO_FONT/orbitron-medium.otf&quot;);
}
@font-face {
     font-family: &quot;Orbitron-Light&quot;;
     src: url(&quot;PATH_TO_FONT/orbitron-light.otf&quot;);
}
.orbitron-black {
     font-family: &quot;Orbitron-Black&quot;, serif;
     font-size:18px;
}
.orbitron-bold {
     font-family: &quot;Orbitron-Bold&quot;, serif;
     font-size:18px;
}
.orbitron-medium {
     font-family: &quot;Orbitron-Medium&quot;, serif;
     font-size:18px;
}
.orbitron-light {
     font-family: &quot;Orbitron-light&quot;, serif;
     font-size:18px;
}
</pre>
<h2>Other options for web licensed fonts</h2>
<p><a href="http://typekit.com/">TypeKit</a> is one of the commercial options with yearly pricing options and a limited free option. You can find commercial fonts here, but unfortunately a lot of the big names are missing. A quick search for favourites like Gotham, Helvetica Neue and Frutiger yielded nothing, so for now I&#8217;ll be sticking with <a href="http://www.google.com/webfonts">Google web fonts</a> and <a href="http://www.theleagueofmoveabletype.com/">The League of Movable Type</a>.</p>
<h2>The future is digital</h2>
<p>It&#8217;s quite annoying that the large font foundries have locked down and prohibited the use of their fonts on the web or only allowed clunky implementations. It&#8217;s as if they believe that if they were to open up their licenses that the world would cease to buy fonts tomorrow. I think it would be quite the opposite. Individual sites that want to embed fonts regardless of whether they own the rights to them or the licensing restrictions are going to use them. Larger corporate sites and individual sites that respect the copyright of fonts will instead move to the quickly growing library of web licensed and free fonts. The future is digital, and the larger foundries really need to wake up before people just move elsewhere for their fonts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ianhoar.com/2011/04/02/the-secrets-to-using-custom-web-fonts/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Creating email newsletter margins with tables</title>
		<link>http://www.ianhoar.com/2011/03/27/creating-email-newsletter-margins-with-tables/</link>
		<comments>http://www.ianhoar.com/2011/03/27/creating-email-newsletter-margins-with-tables/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 01:08:20 +0000</pubDate>
		<dc:creator>Ian Hoar</dc:creator>
				<category><![CDATA[Email]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[email newsletters]]></category>
		<category><![CDATA[Gmail]]></category>
		<category><![CDATA[Outlook]]></category>

		<guid isPermaLink="false">http://www.ianhoar.com/?p=4250</guid>
		<description><![CDATA[This may seem painfully obvious to some, especially the more seasoned old school table based web designers out there, but I&#8217;m still amazed at how many email newsletters don&#8217;t render properly in my inbox. Remember when it comes to email newsletters tables are king and web standards go out the window! It sucks, but that&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-4260" title="Creating email newsletter margins with tables" src="http://www.ianhoar.com/wp-content/uploads/2011/03/tool_kit-e1301273715243.png" alt="Creating email newsletter margins with tables" width="200" height="200" />This may seem painfully obvious to some, especially the more seasoned old school table based web designers out there, but I&#8217;m still amazed at how many email newsletters don&#8217;t render properly in my inbox. Remember <strong>when it comes to email newsletters tables are king and web standards go out the window!</strong> It sucks, but that&#8217;s the way it is, so lets move on.</p>
<p><span id="more-4250"></span></p>
<h2>Use tables everywhere</h2>
<p>And I do mean everywhere, I can&#8217;t stress this enough, <strong>tables are your friend</strong> when it comes to email newsletters. They will ease much suffering, so use them everywhere. The all mighty <strong>spacer gif is your next best friend</strong> when it comes to table based design, and <strong>style=&#8221;display:block&#8221; is your third best friend</strong>. Here&#8217;s why.</p>
<h2>Margins don&#8217;t work in email newsletters!</h2>
<p>Margins are one of the most important css styles used today along with padding. Some email clients strip out margins and padding can be very flaky in others, so what are you to do? You can start by not using them at all. Don&#8217;t bother trying to style your paragraph tags either, I always stress letting them default to whatever the email client likes to do with them. Forcing them to do what you want will probably look wonky in some mail clients. Leave them alone and don&#8217;t bother with margins or padding, it&#8217;s less work for you and your email newsletters will look better for it. You will never have the control you have with web pages.</p>
<p>Suppose we want this example below.</p>
<p><img class="aligncenter size-full wp-image-4254" title="Email Newsletter" src="http://www.ianhoar.com/wp-content/uploads/2011/03/email_newsletter.jpg" alt="Email Newsletter" width="710" height="560" /></p>
<p>In a normal webpage this is a padding div with text and a second div floated right with CSS margins and a paragraph of text  for the caption. In the email world it looks like this.</p>
<p><img class="aligncenter size-full wp-image-4256" title="email newsletter with tables" src="http://www.ianhoar.com/wp-content/uploads/2011/03/email_newsletter_table.jpg" alt="email newsletter with tables" width="710" height="580" /></p>
<p>Red represents an outer table and green represents an inner table. In a real world example of a robust email newsletter you would most likely have far more nested tables then this, but this illustrates our need for tables. Each corner table has a 20&#215;20 pixel, and the inner green table is aligned to the right. A great tool to illustrate this in real time with your own work is the <a href="https://addons.mozilla.org/en-us/firefox/addon/web-developer/">Web Developer Firefox addon</a> by <a href="http://chrispederick.com/">Chris Pederick</a>, which allows you to outline your tables within the browser amongst many other things.</p>
<h2>Table based layout tips</h2>
<p>Remember that a spacer gif should be a 10&#215;10 pixel by default and then stretched to the desired size even if that size is less than 10&#215;10. <a href="http://www.ianhoar.com/2007/10/20/outlook-2007-when-is-200-pixels-not-200-pixels/">A 1&#215;1 pixel will not stretch properly in some versions of Outlook</a> due to a very strange bug.</p>
<p>Each spacer gif should also have an inline style of <strong>style=&#8221;display:block&#8221;</strong>. Many email clients like Gmail will leave white space below all your images making your layout look messy. This same rule applies to visual images, especially if the email is image heavy as you will have white lines caused by space below all the images if you forget to add this to all your images.</p>
<p>When using tables don&#8217;t forget <a href="http://www.ianhoar.com/2010/06/27/outlook-2007-losing-font-family-declaration/">how fonts work with different email clients</a>. Newer versions Outlook for example will not cascade your fonts properly when used in tables, and clients like Gmail will rip out your embedded styles. The solution to this is to use both methods only once eliminating the need to splash font family and font sizes throughout your email newsletters.</p>
<p>With patience it&#8217;s possible to make email newsletters that work in many email clients and are somewhat clean at the same time. Look at email newsletters as yet another exciting challenge to conquer and you might not pull all your hair out. Happy coding.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ianhoar.com/2011/03/27/creating-email-newsletter-margins-with-tables/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating OFT templates for Outlook 2010</title>
		<link>http://www.ianhoar.com/2011/02/06/creating-oft-templates-for-outlook-2010/</link>
		<comments>http://www.ianhoar.com/2011/02/06/creating-oft-templates-for-outlook-2010/#comments</comments>
		<pubDate>Sun, 06 Feb 2011 18:28:53 +0000</pubDate>
		<dc:creator>Ian Hoar</dc:creator>
				<category><![CDATA[Email]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[email newsletters]]></category>
		<category><![CDATA[OFT]]></category>
		<category><![CDATA[Outlook]]></category>

		<guid isPermaLink="false">http://www.ianhoar.com/?p=4230</guid>
		<description><![CDATA[I wrote an article a few years ago on creating OFT files for Outlook. This was written for Outlook 2007, and since then, Outlook 2010 has been released and things have changed. The ability to view web pages within Outlook 2010 has been removed and the UI has also been redone, but fear not, the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-4232" title="Outlook 2010" src="http://www.ianhoar.com/wp-content/uploads/2011/02/Outlook_2010.png" alt="" width="200" height="195" />I wrote an article a few years ago on <a href="http://www.ianhoar.com/2008/02/12/outlook-%E2%80%94-creating-oft-files-for-email-newsletters/">creating OFT files for Outlook</a>. This was written for Outlook 2007, and since then, Outlook 2010 has been released and things have changed. The ability to view web pages within Outlook 2010 has been removed and the UI has also been redone, but fear not, the ability to make OFT files still exists, although it&#8217;s not as straight forward as it used to be.</p>
<p><span id="more-4230"></span></p>
<p>After looking everywhere for a way to load a web page within Outlook 2010, I finally checked Microsoft&#8217;s site only to find out that this ability had been removed entirely. I started thinking about other ways to get a page into Outlook without using a 3rd party mailer application. That&#8217;s when I fired up Internet Explorer and found the <strong>Send Page by e-mail </strong>option. The good news is after several tests the results seem to be the same. To send the HTML to Outlook I used Internet Explorer 8. I&#8217;m not sure if other browsers can do the same, but since this is a proprietary MS format it&#8217;s probably best to stick with IE.</p>
<p>In Internet Explorer go to:</p>
<blockquote><p>File / Send / Page by E-mail&#8230;</p></blockquote>
<p>If you have Outlook 2010 as your default mail client it should automatically load with the page embedded into an email message. Now one would think that by now all you would have to do is save the email as an OFT and be done with it, but for some reason every time I tried this the resulting OFT was a blank file. The trick is to <strong>email the message to yourself</strong> and then save it as an OFT. Don&#8217;t forget to change the <strong>subject title</strong> to whatever you would like the OFT to read.</p>
<p>In Outlook 2010 go to:</p>
<blockquote><p>File / Save As</p>
<p>Select Outlook Template under Save as type:</p></blockquote>
<p>Now you should have an OFT that will work just as 2007 templates worked. Remember when creating OFT files there are many limitations, and tables and spacer GIFs are a must for any remotely complex layouts. Check out the related posts below for more Outlook tips and tricks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ianhoar.com/2011/02/06/creating-oft-templates-for-outlook-2010/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

