<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Six Studios - Home</title>
  <id>tag:blog.sixstudios.com,2009:mephisto/</id>
  <generator uri="http://mephistoblog.com" version="0.8.0">Mephisto Drax</generator>
  <link href="http://blog.sixstudios.com/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://blog.sixstudios.com/" rel="alternate" type="text/html"/>
  <updated>2009-04-12T20:35:51Z</updated>
  <entry xml:base="http://blog.sixstudios.com/">
    <author>
      <name>dane</name>
    </author>
    <id>tag:blog.sixstudios.com,2009-04-12:22</id>
    <published>2009-04-12T20:33:00Z</published>
    <updated>2009-04-12T20:35:51Z</updated>
    <category term="Rails"/>
    <category term="Ruby"/>
    <link href="http://blog.sixstudios.com/2009/4/a-new-sitemap-plugin-for-mephisto" rel="alternate" type="text/html"/>
    <title>A new sitemap plugin for Mephisto</title>
<content type="html">
            &lt;p&gt;Search engines such as Google, Yahoo, &lt;span class=&quot;caps&quot;&gt;MSN&lt;/span&gt; and Ask decided on a sitemap.xml file/schema a while back.&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;The Sitemap Protocol allows you to inform search engines about URLs on your websites that are available for crawling.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;&lt;cite&gt;&lt;a href=&quot;https://www.google.com/webmasters/tools/docs/en/protocol.html&quot;&gt;Google &#8211; Webmaster Tools&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;


	&lt;p&gt;When a website is re-indexed this sitemap.xml file is scanned for added and updated pages. For faster indexing, search engines can also be notified, or pinged, when content has been added to your website.&lt;/p&gt;


	&lt;p&gt;A plugin was made for the &lt;a href=&quot;http://www.mephistoblog.com&quot;&gt;Mephisto Blog&lt;/a&gt; to generate the sitemap.xml file. &lt;a href=&quot;http://github.com/tuupola/mephisto_sitemap/tree/master&quot;&gt;That plugin can be found here&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;I made a fork the mephisto_sitemap plugin and added code to ping Google, Yahoo, &lt;span class=&quot;caps&quot;&gt;MSN&lt;/span&gt; and Ask everytime a post has been added/updated. You can find it on &lt;a href=&quot;http://www.github.com/sixstudios&quot;&gt;my Github Repository&lt;/a&gt;.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.sixstudios.com/">
    <author>
      <name>dane</name>
    </author>
    <id>tag:blog.sixstudios.com,2009-04-04:19</id>
    <published>2009-04-04T23:13:00Z</published>
    <updated>2009-05-27T16:53:59Z</updated>
    <category term="XHTML/CSS"/>
    <link href="http://blog.sixstudios.com/2009/4/display-inline-block-and-internet-explorer" rel="alternate" type="text/html"/>
    <title>display: inline-block, browsers, and you</title>
<summary type="html">&lt;p&gt;Block level elements are easy to work with. You can give them a height and width, and they&#8217;ll pretty much look how you intended. Inline elements, such as links and spans, will flow with the document content. They can&#8217;t be styled with the height or width &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; attributes.&lt;/p&gt;


	&lt;h2&gt;&lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; to the rescue&lt;/h2&gt;


	&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; allows us to control how the element is displayed with the &lt;strong&gt;display&lt;/strong&gt; attribute. A link will display as a block level element because of  the following:&lt;/p&gt;


&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;kw&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;ps&quot;&gt;:link&lt;/span&gt;, &lt;span class=&quot;kw&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;ps&quot;&gt;:visited&lt;/span&gt; {&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;ke&quot;&gt;display&lt;/span&gt;: &lt;span class=&quot;vl&quot;&gt;block&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;}&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;</summary><content type="html">
            &lt;p&gt;Block level elements are easy to work with. You can give them a height and width, and they&#8217;ll pretty much look how you intended. Inline elements, such as links and spans, will flow with the document content. They can&#8217;t be styled with the height or width &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; attributes.&lt;/p&gt;


	&lt;h2&gt;&lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; to the rescue&lt;/h2&gt;


	&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; allows us to control how the element is displayed with the &lt;strong&gt;display&lt;/strong&gt; attribute. A link will display as a block level element because of  the following:&lt;/p&gt;


&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;kw&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;ps&quot;&gt;:link&lt;/span&gt;, &lt;span class=&quot;kw&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;ps&quot;&gt;:visited&lt;/span&gt; {&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;ke&quot;&gt;display&lt;/span&gt;: &lt;span class=&quot;vl&quot;&gt;block&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;}&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;h2&gt;inline-block?&lt;/h2&gt;


	&lt;p&gt;There is a hybrid property of &lt;strong&gt;display: block&lt;/strong&gt; and &lt;strong&gt;display: inline&lt;/strong&gt;, it&#8217;s &lt;strong&gt;display: inline-block&lt;/strong&gt;. You wont see it used much because Internet Explorer doesn&#8217;t fully support it. Firefox and Safari do support the inline-block property properly.&lt;/p&gt;


	&lt;p&gt;Internet Explorer offers no support for &lt;strong&gt;display: inline-block&lt;/strong&gt; on block level elements (eg: ul, li, div, p, h1-h6, etc). It does, however, provide support with inline elements (eg: img, span, a). &lt;a href=&quot;http://blog.sixstudios.com/blog/examples/2009/04/display-inline-block.html&quot;&gt;Here is an example&lt;/a&gt; of &lt;strong&gt;display: inline-block&lt;/strong&gt; used on a paragraph tag and a span. The span works properly in Internet Explorer 6 and 7, Firefox and Safari. The paragraph, on the other hand, still presents itself as a block level element and ignores the &lt;strong&gt;display: inline-block&lt;/strong&gt; styling.&lt;/p&gt;


	&lt;h2&gt;How to use this&lt;/h2&gt;


	&lt;p&gt;Floating &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; elements can get messy really fast and &lt;a href=&quot;http://blog.sixstudios.com/2009/3/floating-results-in-floating-text&quot;&gt;things like this&lt;/a&gt; can happen. In most sites I build floating starts in the main navigation and can grow to floating may elements after that. A combination of &lt;strong&gt;display: inline&lt;/strong&gt; and &lt;strong&gt;display: inline-block&lt;/strong&gt; can elevate the need for floating in the main navigation all together. &lt;a href=&quot;http://blog.sixstudios.com/blog/examples/2009/04/better-navigation.html&quot;&gt;Here is an example of it&lt;/a&gt;.&lt;/p&gt;


This code example sets the LI elements to &lt;strong&gt;display: inline&lt;/strong&gt; to bring the list of links on the same line. The links are then set to &lt;strong&gt;display: inline-block&lt;/strong&gt; This can be done because links are inline elements and, like stated above in the article, Internet Explorer 6 and 7, Firefox and Safari support &lt;strong&gt;display: inline-block&lt;/strong&gt; on inline elements. 
&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;co&quot;&gt;#mainNav&lt;/span&gt; &lt;span class=&quot;kw&quot;&gt;li&lt;/span&gt; {&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;ke&quot;&gt;display&lt;/span&gt;: &lt;span class=&quot;vl&quot;&gt;inline&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;}&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;co&quot;&gt;#mainNav&lt;/span&gt; &lt;span class=&quot;kw&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;ps&quot;&gt;:link&lt;/span&gt;, &lt;span class=&quot;co&quot;&gt;#mainNav&lt;/span&gt; &lt;span class=&quot;kw&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;ps&quot;&gt;:visited&lt;/span&gt; {&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;ke&quot;&gt;display&lt;/span&gt;: &lt;span class=&quot;vl&quot;&gt;inline-block&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;}&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


	&lt;p&gt;Happy coding!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.sixstudios.com/">
    <author>
      <name>dane</name>
    </author>
    <id>tag:blog.sixstudios.com,2009-04-02:18</id>
    <published>2009-04-02T04:14:00Z</published>
    <updated>2009-04-03T05:56:23Z</updated>
    <category term="PHP"/>
    <category term="Rails"/>
    <link href="http://blog.sixstudios.com/2009/4/mephisto-and-wordpress" rel="alternate" type="text/html"/>
    <title>Mephisto and Wordpress</title>
<content type="html">
            &lt;p&gt;The Six Studios blog launched initially with &lt;a href=&quot;http://www.wordpress.org&quot;&gt;Wordpress&lt;/a&gt; and has since moved to &lt;a href=&quot;http://www.mephistoblog.com&quot;&gt;Mephisto&lt;/a&gt;. Both are excellent products, but appeal to two very different audiences.&lt;/p&gt;


	&lt;h2&gt;Wordpress out of the box&lt;/h2&gt;


	&lt;p&gt;Its &lt;a href=&quot;http://www.php.net&quot;&gt;&lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;&lt;/a&gt;. Its easy to install and even easier to use. That&#8217;s why it was my first pick.&lt;/p&gt;


	&lt;p&gt;The text editor is very friendly (&lt;a href=&quot;http://tinymce.moxiecode.com&quot;&gt;TinyMCE&lt;/a&gt;) and so is the interface. The text editor gives the user a presentation view of the content.&lt;/p&gt;


	&lt;p&gt;An &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; view of the post is available too. The presentation view allows the user to see what text is bold, underlined, and italicized, but wont indicate what content a search engine will deem most important. Though &lt;span class=&quot;caps&quot;&gt;WYSIWYG&lt;/span&gt; editors are the easiest editors to use, presentation without proper tagging only solves half the problem. The code is left for the search engine to decide what is most relevant instead of tagging it as such.&lt;/p&gt;


	&lt;h2&gt;Mephisto out of the box&lt;/h2&gt;


	&lt;p&gt;Its &lt;a href=&quot;http://www.rubyonrails.org&quot;&gt;Rails&lt;/a&gt;. You&#8217;re required to know how a Rails application works in order to set it up. This isn&#8217;t significant for a developer or a tech savvy person with Google at his/her finger tips, but for the average person that wants a blog it might be to much to ask.&lt;/p&gt;


	&lt;p&gt;Mephisto&#8217;s text editor allows the user to format each post with Textile, Markdown, Markdown with Smarty Pants and plain &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt;. This gives the user much more control upfront, but requires knowledge of the markup syntax and proper tagging. Though more work is needed, utilizing proper tags such as header (h1-h6) tags will yield a better results in search engines.&lt;/p&gt;


	&lt;p&gt;Coderay for syntax highlighting and Akismet &lt;span class=&quot;caps&quot;&gt;SPAM&lt;/span&gt; blocking are also built into Mephisto.&lt;/p&gt;


	&lt;h2&gt;Thoughts&lt;/h2&gt;


	&lt;p&gt;Out of the box Wordpress is meant to answer the needs of most. Get up and get posting. Mephisto answering the needs of a developer and the code-conscious. Syntax highlighting and proper code formatting.&lt;/p&gt;


	&lt;p&gt;Two very different targets. Two excellent products.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.sixstudios.com/">
    <author>
      <name>dane</name>
    </author>
    <id>tag:blog.sixstudios.com,2009-03-26:1</id>
    <published>2009-03-26T03:59:00Z</published>
    <updated>2009-04-03T05:27:48Z</updated>
    <category term="XHTML/CSS"/>
    <link href="http://blog.sixstudios.com/2009/3/labels-align-below-radio-dots-and-checkboxes" rel="alternate" type="text/html"/>
    <title>Labels align below radio dots and check boxes</title>
<content type="html">
            &lt;p&gt;Like the title says, &#8220;labels align below radio dots and check boxes.&#8221;&lt;/p&gt;


	&lt;p&gt;&lt;/p&gt;


	&lt;p&gt;Its subtle, but its enough to make a page imperfect. The simple fix for this is to apply a class to the labels  you wish to fix. In this example I&#8217;ll use the class &#8220;valign.&#8221;&lt;/p&gt;


	&lt;p&gt;Include the following &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt;:&lt;/p&gt;


&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;kw&quot;&gt;label&lt;/span&gt;&lt;span class=&quot;cl&quot;&gt;.valign&lt;/span&gt; {&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;ke&quot;&gt;position&lt;/span&gt;: &lt;span class=&quot;vl&quot;&gt;relative&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;ke&quot;&gt;bottom&lt;/span&gt;: &lt;span class=&quot;fl&quot;&gt;3px&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;}&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


	&lt;p&gt;The &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; will move the &#8220;valign&#8221; labels up 3 pixels. For Internet Explorer you&#8217;ll need to use 2 pixels (2px).&lt;/p&gt;


	&lt;p&gt;&lt;a href=&quot;/blog/2008/12/browser-specific-css-files/&quot;&gt;You can read more on browser specific &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; here.&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Here is the final product:&lt;/p&gt;


	&lt;p&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.sixstudios.com/">
    <author>
      <name>dane</name>
    </author>
    <id>tag:blog.sixstudios.com,2009-03-22:8</id>
    <published>2009-03-22T03:47:00Z</published>
    <updated>2009-03-31T14:12:41Z</updated>
    <category term="PHP"/>
    <category term="Ruby"/>
    <link href="http://blog.sixstudios.com/2009/3/php-to-ruby-lesson-2" rel="alternate" type="text/html"/>
    <title>PHP to Ruby: Lesson 2</title>
<content type="html">
            In the &lt;a href=&quot;/blog/2009/03/php-to-ruby-lesson-1/&quot;&gt;first lesson&lt;/a&gt; we went over basic similarities of Ruby and &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;. Lets go over some more.
&lt;h3&gt;The Basics&lt;/h3&gt;
Its essential to know what type of data you&#8217;re working with. Whether its a string, integer or an array, we need to know what type of data we&#8217;re about to manipulate.

	&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; has the following functions &lt;strong&gt;is_array()&lt;/strong&gt;, &lt;strong&gt;is_bool()&lt;/strong&gt;, &lt;strong&gt;is_integer()&lt;/strong&gt;, &lt;strong&gt;is_object()&lt;/strong&gt;, &lt;strong&gt;is_string()&lt;/strong&gt;, and many more.&lt;/p&gt;


	&lt;p&gt;Ruby also provides this functionality. Remember from the first lesson, Ruby is an object-oriented language so data type checking will be done with the method &lt;strong&gt;is_a?&lt;/strong&gt;. Here are some examples:&lt;/p&gt;


&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;# PHP&lt;tt&gt;
&lt;/tt&gt;if(is_string($var))&lt;tt&gt;
&lt;/tt&gt;...&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;if(is_integer($var))&lt;tt&gt;
&lt;/tt&gt;...&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


In Ruby:
&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;# Ruby&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; var.is_a? &lt;span class=&quot;co&quot;&gt;String&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;...&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; var.is_a? &lt;span class=&quot;co&quot;&gt;Integer&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;...&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


	&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; is very powerful when working with arrays. A few useful functions are &lt;strong&gt;array_keys()&lt;/strong&gt;, &lt;strong&gt;array_values()&lt;/strong&gt;, &lt;strong&gt;explode()&lt;/strong&gt; and &lt;strong&gt;implode()&lt;/strong&gt;.&lt;/p&gt;


	&lt;p&gt;For Ruby, in the same order, the methods are &lt;strong&gt;keys&lt;/strong&gt;, &lt;strong&gt;values&lt;/strong&gt;, &lt;strong&gt;split&lt;/strong&gt; and &lt;strong&gt;join&lt;/strong&gt;.&lt;/p&gt;


&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;# PHP&lt;tt&gt;
&lt;/tt&gt;$var = array( 'my',=&amp;gt;1, 'php'=&amp;gt;2, 'hash'=&amp;gt;3 );&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;$keys = array_keys($var); # using array_keys()&lt;tt&gt;
&lt;/tt&gt;$values = array_values($var); # using array_values()&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;$new_array = explode(' ','my php array'); # using explode()&lt;tt&gt;
&lt;/tt&gt;$new_string = implode(' ', $new_array); # using implode()&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


	&lt;p&gt;And for Ruby:&lt;/p&gt;


&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;# Ruby&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;var = { &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;my&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ruby&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; =&amp;gt;&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;hash&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;i&quot;&gt;3&lt;/span&gt; }&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;keys = var.keys &lt;span class=&quot;c&quot;&gt;# using keys method&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;values = var.values&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;new_array = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;my ruby array&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;.split(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; &lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;) &lt;span class=&quot;c&quot;&gt;# using split method&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;new_string = new_array.join(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; &lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# splitting a string option 2&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;new_array = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;%W(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;my ruby array&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


	&lt;p&gt;Hope this was helpful.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.sixstudios.com/">
    <author>
      <name>dane</name>
    </author>
    <id>tag:blog.sixstudios.com,2009-03-20:7</id>
    <published>2009-03-20T01:46:00Z</published>
    <updated>2009-03-31T14:12:34Z</updated>
    <category term="XHTML/CSS"/>
    <link href="http://blog.sixstudios.com/2009/3/floating-results-in-floating-text" rel="alternate" type="text/html"/>
    <title>Floating results in floating text</title>
<content type="html">
            &lt;p&gt;In a very special case Internet Explorer 6 will do something very strange with text. This special case is caused by excessive floating of parent and child elements.&lt;/p&gt;


&lt;p class=&quot;align_center&quot;&gt;&lt;/p&gt;

	&lt;p&gt;You&#8217;ll notice the &#8220;magna, non&#8221; text belongs in the blue-ish box, but it appears in a mysterious location. I&#8217;ve only seen this in Internet Explorer 6.&lt;/p&gt;


	&lt;p&gt;Luckily this problem can be fixed by setting the container of the floating text to &lt;strong&gt;position: relative&lt;/strong&gt;.&lt;/p&gt;


	&lt;p&gt;This is rendering issue inside Internet Explorer 6. I have only come across it, as stated above, after floating too many parent and child elements. Seeing this should inform the developer that the page can be structured in a cleaner manner, but if rebuilding isn&#8217;t an option just set the container to &lt;strong&gt;position: relative&lt;/strong&gt;.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.sixstudios.com/">
    <author>
      <name>dane</name>
    </author>
    <id>tag:blog.sixstudios.com,2009-03-14:6</id>
    <published>2009-03-14T00:15:00Z</published>
    <updated>2009-03-31T14:12:28Z</updated>
    <category term="JavaScript"/>
    <category term="PHP"/>
    <category term="Ruby"/>
    <link href="http://blog.sixstudios.com/2009/3/php-to-ruby-lesson-1" rel="alternate" type="text/html"/>
    <title>PHP to Ruby: Lesson 1</title>
<summary type="html">&lt;h3&gt;The very basics&lt;/h3&gt;
The Ruby language is object-oriented. &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; is not object-oriented, but has objects. Ruby&#8217;s object-oriented nature results in some areas of it&#8217;s syntax to look very much like JavaScript.

&lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;&#8217;s &lt;strong&gt;echo&lt;/strong&gt; is &lt;strong&gt;puts&lt;/strong&gt; in Ruby. &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; uses semicolons. Ruby uses semicolons, but only in specific cases. For clean, readable code, assume you won&#8217;t be needing semicolons. Lets being&#8230;
&lt;h3&gt;The Basics&lt;/h3&gt;
&lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; creates arrays and hashes with the same function &lt;strong&gt;array()&lt;/strong&gt;.
&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;# PHP&lt;tt&gt;
&lt;/tt&gt;$array = array('my', 'php', 'array');&lt;tt&gt;
&lt;/tt&gt;$hash = array(&lt;tt&gt;
&lt;/tt&gt;   'my_index'=&amp;gt;'my_value',&lt;tt&gt;
&lt;/tt&gt;   'my_second_index'=&amp;gt;'my_second_value'&lt;tt&gt;
&lt;/tt&gt;);&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


	&lt;p&gt;Ruby handles arrays and hashes separately.&lt;/p&gt;


&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;# Ruby&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;array = [&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;my&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ruby&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;]&lt;tt&gt;
&lt;/tt&gt;hash = {&lt;tt&gt;
&lt;/tt&gt;   &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;my_index&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;my_value&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,&lt;tt&gt;
&lt;/tt&gt;   &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;my_second_index&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;my_second_value&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;}&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;</summary><content type="html">
            &lt;h3&gt;The very basics&lt;/h3&gt;
The Ruby language is object-oriented. &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; is not object-oriented, but has objects. Ruby&#8217;s object-oriented nature results in some areas of it&#8217;s syntax to look very much like JavaScript.

&lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;&#8217;s &lt;strong&gt;echo&lt;/strong&gt; is &lt;strong&gt;puts&lt;/strong&gt; in Ruby. &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; uses semicolons. Ruby uses semicolons, but only in specific cases. For clean, readable code, assume you won&#8217;t be needing semicolons. Lets being&#8230;
&lt;h3&gt;The Basics&lt;/h3&gt;
&lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; creates arrays and hashes with the same function &lt;strong&gt;array()&lt;/strong&gt;.
&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;# PHP&lt;tt&gt;
&lt;/tt&gt;$array = array('my', 'php', 'array');&lt;tt&gt;
&lt;/tt&gt;$hash = array(&lt;tt&gt;
&lt;/tt&gt;   'my_index'=&amp;gt;'my_value',&lt;tt&gt;
&lt;/tt&gt;   'my_second_index'=&amp;gt;'my_second_value'&lt;tt&gt;
&lt;/tt&gt;);&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


	&lt;p&gt;Ruby handles arrays and hashes separately.&lt;/p&gt;


&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;# Ruby&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;array = [&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;my&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ruby&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;]&lt;tt&gt;
&lt;/tt&gt;hash = {&lt;tt&gt;
&lt;/tt&gt;   &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;my_index&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;my_value&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,&lt;tt&gt;
&lt;/tt&gt;   &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;my_second_index&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;my_second_value&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;}&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Take note that Ruby creates arrays and hashes in the same syntax as JavaScript. Also note that there is no semicolon. Ruby doesn&#8217;t use them unless multiple commands are on the same line. That can lead to messy code or for loops so we&#8217;ll get into that later.&lt;/p&gt;


&lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; uses curly brackets for blocking multiple commands and no curly brackets for single commands.
&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;# PHP&lt;tt&gt;
&lt;/tt&gt;if($is_php)&lt;tt&gt;
&lt;/tt&gt;   echo &amp;quot;Yes this is PHP&amp;quot;; # single command&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;if($is_php) {&lt;tt&gt;
&lt;/tt&gt;   echo &amp;quot;Yes this is PHP&amp;quot;; # first command&lt;tt&gt;
&lt;/tt&gt;   echo &amp;quot;Its great!&amp;quot;;&lt;tt&gt;
&lt;/tt&gt;}&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


	&lt;p&gt;Ruby uses &lt;strong&gt;do&lt;/strong&gt; and &lt;strong&gt;end&lt;/strong&gt; for blocking multiple commands and curly brackets for single command blocks.&lt;/p&gt;


&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;# Ruby&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; is_ruby { puts &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;This is ruby!&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; } &lt;span class=&quot;c&quot;&gt;# single command&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;puts &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;This is a backwards if statement&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; is_ruby &lt;span class=&quot;c&quot;&gt;# variation of single command&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; is_ruby &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;   puts &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;This is ruby!&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# first command&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;   puts &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Its awesome!&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# second command&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


&lt;h3&gt;Still pretty basic&lt;/h3&gt;
&lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; has the &lt;strong&gt;foreach()&lt;/strong&gt; function.

&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;# PHP&lt;tt&gt;
&lt;/tt&gt;$array = array('this','is','a','php','test');&lt;tt&gt;
&lt;/tt&gt;foreach($array as $el)&lt;tt&gt;
&lt;/tt&gt;   echo &amp;quot;$el&amp;quot;;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


	&lt;p&gt;Ruby has an &lt;strong&gt;each &lt;/strong&gt;method.&lt;/p&gt;


&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;# Ruby&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;array = [&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;is&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ruby&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;]&lt;tt&gt;
&lt;/tt&gt;array.each &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |el|&lt;tt&gt;
&lt;/tt&gt;  puts el&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;array.each { |el| puts el } &lt;span class=&quot;c&quot;&gt;# the single lined version&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


	&lt;p&gt;Another Javascript similarity. The method &lt;strong&gt;each &lt;/strong&gt;should look familiar to anyone that has used any of the popular Javascript frameworks &lt;a href=&quot;http://prototypejs.org/&quot;&gt;Prototype&lt;/a&gt;, &lt;a href=&quot;http://mootools.net&quot;&gt;Mootools&lt;/a&gt;, and &lt;a href=&quot;http://jquery.com&quot;&gt;jQuery&lt;/a&gt;.&lt;/p&gt;


&lt;h3&gt;Ruby and the web&lt;/h3&gt;

	&lt;p&gt;One of Ruby&#8217;s best web friends is eRuby (embedded Ruby). eRuby will make the &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; to Ruby transition that much smoother. For example:&lt;/p&gt;


&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;# PHP&lt;tt&gt;
&lt;/tt&gt;&amp;lt;? if($is_php) { ?&amp;gt;;&lt;tt&gt;
&lt;/tt&gt;  PHP is great!&lt;tt&gt;
&lt;/tt&gt;&amp;lt;? } ?&amp;gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


And with eRuby:
&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;# Ruby&lt;tt&gt;
&lt;/tt&gt;&amp;lt;% if is_ruby do %&amp;gt;;&lt;tt&gt;
&lt;/tt&gt;  Ruby is awesome!&lt;tt&gt;
&lt;/tt&gt;&amp;lt;% end %&amp;gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


	&lt;p&gt;That will wrap up this entry, but there is more to come.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.sixstudios.com/">
    <author>
      <name>dane</name>
    </author>
    <id>tag:blog.sixstudios.com,2009-01-07:5</id>
    <published>2009-01-07T23:32:00Z</published>
    <updated>2009-03-31T14:12:21Z</updated>
    <category term="XHTML/CSS"/>
    <link href="http://blog.sixstudios.com/2009/1/overflow-hidden-position-relative-doesnt-work-in-ie-67" rel="alternate" type="text/html"/>
    <title>overflow: hidden + position: relative doesn't work in IE 6/7</title>
<content type="html">
            &lt;h3&gt;Problem&lt;/h3&gt;
I hit an &lt;span class=&quot;caps&quot;&gt;IE 6&lt;/span&gt;/7 bug today. My &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; was as follows:
&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;id&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;container&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;ta&quot;&gt;&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;ta&quot;&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;ta&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;Link&lt;span class=&quot;ta&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;ta&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;Link&lt;span class=&quot;ta&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;ta&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;Link&lt;span class=&quot;ta&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    ...&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;ta&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


	&lt;p&gt;My &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; was as follows:&lt;/p&gt;


&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;kw&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;co&quot;&gt;#container&lt;/span&gt; {&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;ke&quot;&gt;overflow&lt;/span&gt;: &lt;span class=&quot;vl&quot;&gt;hidden&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;ke&quot;&gt;height&lt;/span&gt;: &lt;span class=&quot;fl&quot;&gt;400px&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;}&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;kw&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;co&quot;&gt;#container&lt;/span&gt; &lt;span class=&quot;kw&quot;&gt;ul&lt;/span&gt; {&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;ke&quot;&gt;position&lt;/span&gt;: &lt;span class=&quot;vl&quot;&gt;relative&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;}&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


	&lt;p&gt;The list content would display &lt;em&gt;and &lt;/em&gt;flow outside of the container.&lt;/p&gt;


&lt;h3&gt;Solution&lt;/h3&gt;
Setting the UL to position: relative causes the bug in Internet Explorer 6 and 7.

	&lt;p&gt;Moments after finding the source of the problem I was pointed to this article by a friend:&lt;/p&gt;


	&lt;p&gt;&lt;a href=&quot;http://www.defusion.org.uk/archives/2007/04/02/when-overflow-hidden-doesnt-hide-in-ie/&quot;&gt;http://www.defusion.org.uk/archives/2007/04/02/when-overflow-hidden-doesnt-hide-in-ie/&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;In the article the writer isn&#8217;t aware if the bug exists in Internet Explorer 7. Yes it does.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.sixstudios.com/">
    <author>
      <name>dane</name>
    </author>
    <id>tag:blog.sixstudios.com,2009-01-06:4</id>
    <published>2009-01-06T23:22:00Z</published>
    <updated>2009-04-23T00:59:57Z</updated>
    <category term="XHTML/CSS"/>
    <link href="http://blog.sixstudios.com/2009/1/creating-e-mail-newsletters" rel="alternate" type="text/html"/>
    <title>Creating E-mail Newsletters</title>
<summary type="html">&lt;h2&gt;Limit your tools&lt;/h2&gt;


	&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; newsletters &lt;em&gt;can &lt;/em&gt;be very easy to build. To do this you&#8217;ll need to reduce your daily web toolset to a select few.&lt;/p&gt;


	&lt;p&gt;You&#8217;ll have tables, images, spans, paragraphs, div&#8217;s, links, hr&#8217;s, and br&#8217;s at your disposal.&lt;/p&gt;


	&lt;p&gt;All &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; will have to be inline and limited to the following attributes:  height, width, line-height, font (and variants like font-size/font-family), color, text-align, border (and its variants), and list-style (and its variants) if needed.&lt;/p&gt;


	&lt;p&gt;Do not use &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; padding, margin or the table attribute cellpadding. These 3 attributes will drastically reduce the level of compatibility with webmail clients.&lt;/p&gt;</summary><content type="html">
            &lt;h2&gt;Limit your tools&lt;/h2&gt;


	&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; newsletters &lt;em&gt;can &lt;/em&gt;be very easy to build. To do this you&#8217;ll need to reduce your daily web toolset to a select few.&lt;/p&gt;


	&lt;p&gt;You&#8217;ll have tables, images, spans, paragraphs, div&#8217;s, links, hr&#8217;s, and br&#8217;s at your disposal.&lt;/p&gt;


	&lt;p&gt;All &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; will have to be inline and limited to the following attributes:  height, width, line-height, font (and variants like font-size/font-family), color, text-align, border (and its variants), and list-style (and its variants) if needed.&lt;/p&gt;


	&lt;p&gt;Do not use &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; padding, margin or the table attribute cellpadding. These 3 attributes will drastically reduce the level of compatibility with webmail clients.&lt;/p&gt;
&lt;h2&gt;Prep for the newsletter&lt;/h2&gt;


	&lt;p&gt;The first step of creating the e-mail newsletter is to place all of your required images in a publicly accessible location online. Keep in mind, some e-mail clients disable images by default so use them only when absolutely necessary.&lt;/p&gt;


The second and reoccurring step, set the padding and margin to &#8220;0&#8221; on each element that has default values to these attributes.
&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;body&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;style&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;padding: 0; margin: 0&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;ta&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

These are the following elements that have default padding and margin values: body, headers (h1-h6), paragraphs, and lists (ul and ol). Make sure to set each of these attributes to &#8220;0&#8221; if/when you use them in your e-mail newsletter.

	&lt;h2&gt;Begin development of the e-mail newsletter&lt;/h2&gt;


	&lt;p&gt;Your e-mail newsletter will be built with tables. There will most likely be nested tables as well. For every table you create set cellpadding, cellspacing, and border attributes to &#8220;0.&#8221; You will also have to redefine the font styling for each table. This is necessary because tables do not inherit the font properties of their parent containers.&lt;/p&gt;


&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;table&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;cellpadding&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;cellspacing&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;border&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;style&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;font: 12px Helvetica, Arial, sans-serif&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;ta&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


	&lt;p&gt;If your e-mail newsletter is multi-columned, create a containing table with an equal number of cells as the newsletter design has columns. This example depicts a two column newsletter.&lt;/p&gt;


&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;table&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;cellpadding&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;cellspacing&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;border&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;width&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;600&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;ta&quot;&gt;&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;ta&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;ta&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;width&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;ta&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- main content block --&amp;gt;&lt;/span&gt; &lt;span class=&quot;ta&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;ta&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;width&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;ta&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- right column block --&amp;gt;&lt;/span&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;ta&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


	&lt;h2&gt;Need Padding?&lt;/h2&gt;


	&lt;p&gt;That we can&#8217;t use padding in &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; or cellpadding in &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt;,  we&#8217;ll have to fake it. I&#8217;ve found the best way to create left and right padding is with additional table cells. Create the table cell, set the width of the cell to the amount of padding required, add a nonbreaking space (&amp;amp;nbsp;) to the cell. The nonbreaking space will ensure that the table cell displays.&lt;/p&gt;


	&lt;p&gt;To produce top and bottom padding I&#8217;ve found it cleanest to use a line break (br) and define the line-height.&lt;/p&gt;


&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;style&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;line-height: 10px&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;ta&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


	&lt;p&gt;Table rows can yield the same result, but this is just cleaner.&lt;/p&gt;


	&lt;h2&gt;No background-color&#8230;&lt;/h2&gt;


	&lt;p&gt;The &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; attribute background and its variants aren&#8217;t completely supported in e-mail clients. Instead, use the bgcolor table and table cell attribute. This will yield the same results as &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt;&#8217;s background-color.&lt;/p&gt;


	&lt;h2&gt;Don&#8217;t forget!&lt;/h2&gt;


	&lt;p&gt;It&#8217;s best practice to start your e-mail newsletter with a &#8220;view online version&#8221; link. An &#8220;unsubscribe&#8221; link is required. This can be presented as a link or instructions.&lt;/p&gt;


	&lt;p&gt;As stated previously, some e-mail clients disable images by default. Most of these e-mail clients will display images automatically &lt;em&gt;if&lt;/em&gt; the sender is in the recipients address book. Add a sentance reminding the reader to add the sending e-mail address to their address book.&lt;/p&gt;


	&lt;h2&gt;Thats it&lt;/h2&gt;


	&lt;p&gt;Those are the rules I follow to create e-mail newsletters that are supported almost everywhere. Here is an example to show all of the development concepts applied in a single newsletter. &lt;a href=&quot;/blog/examples/2009/01/building-newsletters.html&quot;&gt;Check it out!&lt;/a&gt;&lt;/p&gt;


The e-mail newsletters I create a properly supported on the following platforms:
&lt;ul&gt;
    &lt;li&gt;&lt;span class=&quot;caps&quot;&gt;AOL&lt;/span&gt; Web&lt;/li&gt;
    &lt;li&gt;Comcast&lt;/li&gt;
    &lt;li&gt;Earthlink&lt;/li&gt;
    &lt;li&gt;Gmail&lt;/li&gt;
    &lt;li&gt;Mail.com&lt;/li&gt;
    &lt;li&gt;&lt;span class=&quot;caps&quot;&gt;MSN&lt;/span&gt; Hotmail&lt;/li&gt;
    &lt;li&gt;Windows Live Hotmail&lt;/li&gt;
    &lt;li&gt;Yahoo! Mail&lt;/li&gt;
    &lt;li&gt;&lt;span class=&quot;caps&quot;&gt;AOL 9&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;Outlook 2003&lt;/li&gt;
    &lt;li&gt;Outlook 2007&lt;/li&gt;
    &lt;li&gt;Outlook Express 6&lt;/li&gt;
    &lt;li&gt;Outlook XP&lt;/li&gt;
    &lt;li&gt;Thunderbird&lt;/li&gt;
    &lt;li&gt;Apple Mail&lt;/li&gt;
&lt;/ul&gt;

	&lt;p&gt;Hope it helped!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.sixstudios.com/">
    <author>
      <name>dane</name>
    </author>
    <id>tag:blog.sixstudios.com,2008-12-03:3</id>
    <published>2008-12-03T21:43:00Z</published>
    <updated>2009-03-31T14:12:07Z</updated>
    <category term="JavaScript"/>
    <category term="XHTML/CSS"/>
    <link href="http://blog.sixstudios.com/2008/12/browser-specific-css-files" rel="alternate" type="text/html"/>
    <title>Browser specific CSS files</title>
<summary type="html">&lt;p&gt;Browsers render &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; and &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; differently. Box model hacking is too messy. And there are just better ways of solving your cross-browser problems.&lt;/p&gt;


If the compatibility issues only exist between Internet Explorer and Firefox/Safari the following should suffice:
&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Firefox/Safari --&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;rel&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;stylesheet&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;href&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/assets/css/style.css&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;type&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;text/css&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;media&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;screen&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;ta&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!--[if IE 6]&amp;gt;&lt;tt&gt;
&lt;/tt&gt;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;/assets/css/style_ie6.css type=&amp;quot;text/css&amp;quot; media=&amp;quot;screen&amp;quot; /&amp;gt;&lt;tt&gt;
&lt;/tt&gt;&amp;lt;![endif]--&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!--[if IE 7]&amp;gt;&lt;tt&gt;
&lt;/tt&gt;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;/assets/css/style_ie7.css&amp;quot; type=&amp;quot;text/css&amp;quot; media=&amp;quot;screen&amp;quot; /&amp;gt;&lt;tt&gt;
&lt;/tt&gt;&amp;lt;![endif]--&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;</summary><content type="html">
            &lt;p&gt;Browsers render &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; and &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; differently. Box model hacking is too messy. And there are just better ways of solving your cross-browser problems.&lt;/p&gt;


If the compatibility issues only exist between Internet Explorer and Firefox/Safari the following should suffice:
&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Firefox/Safari --&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;rel&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;stylesheet&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;href&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/assets/css/style.css&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;type&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;text/css&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;media&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;screen&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;ta&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!--[if IE 6]&amp;gt;&lt;tt&gt;
&lt;/tt&gt;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;/assets/css/style_ie6.css type=&amp;quot;text/css&amp;quot; media=&amp;quot;screen&amp;quot; /&amp;gt;&lt;tt&gt;
&lt;/tt&gt;&amp;lt;![endif]--&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!--[if IE 7]&amp;gt;&lt;tt&gt;
&lt;/tt&gt;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;/assets/css/style_ie7.css&amp;quot; type=&amp;quot;text/css&amp;quot; media=&amp;quot;screen&amp;quot; /&amp;gt;&lt;tt&gt;
&lt;/tt&gt;&amp;lt;![endif]--&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;The first and primary style sheet, &#8220;style.css,&#8221; handles everything presentation-wise. Its processed by every browser. If there are rendering issues between Internet Explorer and Firefox and Safari it should contain values appropriate for Firefox and Safari.&lt;/p&gt;


	&lt;p&gt;Next we have some inline logic.&lt;/p&gt;


&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!--[if IE 7]&amp;gt; ...&amp;lt;![endif]--&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


	&lt;p&gt;This is viewed as a comment to every browser except Internet Explorer 7. Anything that exists between the opening and closing if statement is processed solely by the Internet Explorer 7 browser.&lt;/p&gt;


The next code segment is almost identical to the Internet Explorer 7 block.
&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!--[if IE 6]&amp;gt; ...&amp;lt;![endif]--&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

Instead of being read by version 7 of the browser it is only processed by Internet Explorer 6.

In these Internet Explorer 6 and 7 specific style sheets you can define &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; values to override problematic values existing in &#8220;style.css.&#8221; These files are only meant to contain &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; values that differ from the primary style sheet, in order to preserve the desired presentation.
&lt;h3&gt;JavaScript&lt;/h3&gt;
A second approach to solving this problem can be a JavaScript solution. In this example I&#8217;ll use the &lt;a href=&quot;http://www.prototypejs.org&quot;&gt;Prototype &lt;/a&gt;framework.

&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;document.observe(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;dom:loaded&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;kw&quot;&gt;function&lt;/span&gt;(){&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;kw&quot;&gt;var&lt;/span&gt; link = &lt;span class=&quot;kw&quot;&gt;new&lt;/span&gt; Element(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;link&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,{ &lt;span class=&quot;ke&quot;&gt;rel&lt;/span&gt;: &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Stylesheet&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;ke&quot;&gt;rev&lt;/span&gt;: &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Stylesheet&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;ke&quot;&gt;media&lt;/span&gt;: &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;screen&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; });;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;kw&quot;&gt;if&lt;/span&gt;(Prototype.Browser.IE)&lt;tt&gt;
&lt;/tt&gt;  {&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;kw&quot;&gt;if&lt;/span&gt;(navigator.appVersion.search(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;MSIE&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;\ &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;\.&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;)&amp;amp;gt;-&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;) &lt;span class=&quot;c&quot;&gt;// Internet Explorer 7&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      link.setAttribute(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/blog/examples/2008/12/css/browser-specific-ie7.css&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;kw&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kw&quot;&gt;if&lt;/span&gt;(navigator.appVersion.search(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;MSIE&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;\ &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;\.&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;)&amp;amp;gt;-&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;) &lt;span class=&quot;c&quot;&gt;// Internet Explorer 6&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      link.setAttribute(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/blog/examples/2008/12/css/browser-specific-ie6.css&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;  }&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;kw&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kw&quot;&gt;if&lt;/span&gt;(Prototype.Browser.WebKit)&lt;span class=&quot;c&quot;&gt;// Safari&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    link.setAttribute(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/blog/examples/2008/12/css/browser-specific-safari.css&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;kw&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kw&quot;&gt;if&lt;/span&gt;(Prototype.Browser.Opera) &lt;span class=&quot;c&quot;&gt;// Opera&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    link.setAttribute(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/blog/examples/2008/12/css/browser-specific-opera.css&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;c&quot;&gt;// insert link tag into the head of the document&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;pd&quot;&gt;$&lt;/span&gt;(document.getElementsByTagName(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)[&lt;span class=&quot;i&quot;&gt;0&lt;/span&gt;]).insert(link);&lt;tt&gt;
&lt;/tt&gt;});&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

The &lt;a href=&quot;http://www.prototypejs.org&quot;&gt;Prototype&lt;/a&gt; framework allows you to process JavaScript once the &lt;span class=&quot;caps&quot;&gt;DOM&lt;/span&gt; is available, prior the &#8220;onload&#8221; event. This is very useful in our case since we want to include a new style sheet before the page renders.

	&lt;p&gt;The code segment has a check being done for each browser. First it checks if the browser is Internet Explorer and then the version. Next it checks against Safari and finally Opera.&lt;/p&gt;


	&lt;p&gt;The final line of the code segment shows how the link tag is inserted into the document head.&lt;/p&gt;


	&lt;p&gt;&lt;a href=&quot;/blog/examples/2008/12/browser-specific-css.html&quot;&gt;Here is an example&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
</feed>
