<?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"
	>

<channel>
	<title>Word up, son!</title>
	<atom:link href="http://orlandodefrias.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://orlandodefrias.com</link>
	<description>Thoughts on the absurdity of everything, plus neat-o web development tips.</description>
	<pubDate>Sat, 13 Feb 2010 20:14:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Is it possible to be happy?</title>
		<link>http://orlandodefrias.com/2010/02/13/is-it-possible-to-be-happy/</link>
		<comments>http://orlandodefrias.com/2010/02/13/is-it-possible-to-be-happy/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 20:14:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Quick posts]]></category>

		<category><![CDATA[fuck scientology]]></category>

		<category><![CDATA[happy]]></category>

		<category><![CDATA[reddit]]></category>

		<guid isPermaLink="false">http://orlandodefrias.com/?p=17</guid>
		<description><![CDATA[Reddit wants to know, is it possible to be happy?
]]></description>
			<content:encoded><![CDATA[<p>Reddit wants to know, <a href="http://www.reddit.com/r/AskReddit/comments/b1pop/is_it_possible_to_be_happy/">is it possible to be happy</a>?</p>
]]></content:encoded>
			<wfw:commentRss>http://orlandodefrias.com/2010/02/13/is-it-possible-to-be-happy/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ChartDirector rocks.</title>
		<link>http://orlandodefrias.com/2010/02/12/chartdirector-rock/</link>
		<comments>http://orlandodefrias.com/2010/02/12/chartdirector-rock/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 16:03:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Software review]]></category>

		<category><![CDATA[charts]]></category>

		<category><![CDATA[graphs]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://orlandodefrias.com/?p=16</guid>
		<description><![CDATA[ChartDirector, the flagship (only?) product from a company called Advanced Software Engineering, is remarkably good. It&#8217;s not the prettiest thing around, but I&#8217;ve been working with it extensively recently in high-intensity graphing software I&#8217;ve been writing.
This little sucker is fast and flexible. It has libraries and documentation for an array of languages; .NET, ASP, PHP, [...]]]></description>
			<content:encoded><![CDATA[<p>ChartDirector, the flagship (only?) product from a company called <a href="http://www.advsofteng.com/">Advanced Software Engineering</a>, is remarkably good. It&#8217;s not the prettiest thing around, but I&#8217;ve been working with it extensively recently in high-intensity graphing software I&#8217;ve been writing.</p>
<p>This little sucker is fast and flexible. It has libraries and documentation for an array of languages; .NET, ASP, PHP, Ruby, Python, C++, Perl, and more. I&#8217;ve been dealing with it in Ruby and it&#8217;s a pleasure.</p>
<p>Unlike other &#8220;prettier&#8221; charting software, ChartDirector renders graphs to an image on the back-end. This is especially useful for graphs with many data points. For example, in the application I&#8217;m working on it&#8217;s not uncommon for an array of 10,000+ data points. Having to download all those data points on the client side for a Flash chart is pretty ridiculous and tedious to plot. The pre-rendered graphs don&#8217;t necessarily mean you have to sacrifice interactivity since you can throw in some smart AJAX and inline image rendering to provide on-the-fly zooming and panning.</p>
<p>When charting large amounts of data at once, give ChartDirector a shot.</p>
]]></content:encoded>
			<wfw:commentRss>http://orlandodefrias.com/2010/02/12/chartdirector-rock/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Adding watermarks to images with mini_magick error 256</title>
		<link>http://orlandodefrias.com/2009/04/08/adding-watermark-to-image-with-mini_magick-error-256/</link>
		<comments>http://orlandodefrias.com/2009/04/08/adding-watermark-to-image-with-mini_magick-error-256/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 14:56:06 +0000</pubDate>
		<dc:creator>Orlando</dc:creator>
		
		<category><![CDATA[Quick posts]]></category>

		<category><![CDATA[Scripting]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[image processing]]></category>

		<category><![CDATA[rails]]></category>

		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://orlandodefrias.com/?p=15</guid>
		<description><![CDATA[I was attempting to watermark an uploaded image using attachment_fu for uploads and the mini_magick gem for processing. I received an odd little error that Google doesn&#8217;t seem to have many answers for. That error is Error 256. This is what I was doing:
after_attachment_saved do &#124;image&#124;
  if image.thumbnail.nil?
    img = MiniMagick::Image.from_file(image.full_filename(:large))
 [...]]]></description>
			<content:encoded><![CDATA[<p>I was attempting to watermark an uploaded image using attachment_fu for uploads and the mini_magick gem for processing. I received an odd little error that Google doesn&#8217;t seem to have many answers for. That error is Error 256. This is what I was doing:</p>
<pre><code class="code_ruby">after_attachment_saved do |image|
  if image.thumbnail.nil?
    img = MiniMagick::Image.from_file(image.full_filename(:large))
    img.combine_options do |c|
      c.gravity 'SouthWest'
      c.draw "image Over 0,0 0,0 "images/logo_watermark.png""
    end

    img.write(image.full_filename(:large))
  end
end</code></pre>
<p>Looks sound, right? Should work, right? Well, oddly enough it didn&#8217;t and I received the error. I know others have used that exact method in the past and it&#8217;s worked fine for them, but for those of us that receive the ambiguous error I&#8217;ve got the answer.</p>
<p>Command line.</p>
<p>Mini_magick is a simple Ruby wrapper for ImageMagick anyway, so let&#8217;s just bypass it altogether and do it ourselves. The code above uses ImageMagick&#8217;s mogrify, but since we&#8217;ve got better control we should go ahead and use ImageMagick&#8217;s composite which gives us a better looking watermark on images. The original code turns into this:</p>
<pre><code class="code_ruby">after_attachment_saved do |image|
  if image.thumbnail.nil?
    img = image.full_filename(:large)
    system("composite -gravity SouthWest -watermark 10.0 -dissolve 75% 'images/logo_watermark.png' "#{img}" "#{img}"")
  end
end</code></pre>
<p>There you have it.</p>
<p><strong>UPDATE:</strong> The HTML &#8220;code&#8221; tag is parsing the escaped quotes. Make sure you escape the quotes around &#8220;#{img}&#8221; so they turn into \&#8221;#{img}\&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://orlandodefrias.com/2009/04/08/adding-watermark-to-image-with-mini_magick-error-256/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Embed your free online portfolio from SHOWN&#8217;D</title>
		<link>http://orlandodefrias.com/2009/01/05/embed-your-free-online-portfolio-from-shownd/</link>
		<comments>http://orlandodefrias.com/2009/01/05/embed-your-free-online-portfolio-from-shownd/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 19:07:13 +0000</pubDate>
		<dc:creator>Orlando</dc:creator>
		
		<category><![CDATA[My sites/apps]]></category>

		<category><![CDATA[Quick posts]]></category>

		<category><![CDATA[apps]]></category>

		<category><![CDATA[portfolio]]></category>

		<category><![CDATA[shownd]]></category>

		<guid isPermaLink="false">http://orlandodefrias.com/?p=14</guid>
		<description><![CDATA[I just finished adding a feature on SHOWN&#8217;D that allows you to embed your showcase directly to an external site. It can be your blog, personal page, business page, or anything that you can place a simple script into. The script is automatically generated for you whenever you update your portfolio, and you can even [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished adding a feature on SHOWN&#8217;D that allows you to embed your showcase directly to an external site. It can be your blog, personal page, business page, or anything that you can place a simple script into. The script is automatically generated for you whenever you update your portfolio, and you can even play around with the style settings. You don&#8217;t need to change scripts after generating a new one, it simply keeps updating itself on your site as you update your portfolio on SHOWN&#8217;D. Below is my embedded showcase:</p>
<p><script type="text/javascript" src="http://files.shownd.com/o/r/l/orlando/embed.js"></script></p>
<p>Pretty neat, huh? It&#8217;s in the early stages so there may be a couple of bugs here and there. What I would like is for many people to use it so I can fine tune it to different setups. The plan is to allow paid users to have more options in modifying the style and also the option to remove the SHOWN&#8217;D logo. I&#8217;m thinking letting them directly access the CSS would be a good way to give them the versatility they may want.</p>
]]></content:encoded>
			<wfw:commentRss>http://orlandodefrias.com/2009/01/05/embed-your-free-online-portfolio-from-shownd/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ruby snippet: Return a different string if empty or if replacing</title>
		<link>http://orlandodefrias.com/2008/12/24/ruby-snippet-return-a-different-string-if-empty-or-if-replacing/</link>
		<comments>http://orlandodefrias.com/2008/12/24/ruby-snippet-return-a-different-string-if-empty-or-if-replacing/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 04:53:26 +0000</pubDate>
		<dc:creator>Orlando</dc:creator>
		
		<category><![CDATA[Quick posts]]></category>

		<category><![CDATA[Scripting]]></category>

		<category><![CDATA[rails]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://orlandodefrias.com/?p=13</guid>
		<description><![CDATA[In my latest Rails project I needed a quick way to return a string if that string happened to be blank, and also a way to return a different string if the existing string is set. Here&#8217;s the solution I came up with which I placed in extras.rb in my lib directory (require &#8216;extras&#8217; in [...]]]></description>
			<content:encoded><![CDATA[<p>In my latest Rails project I needed a quick way to return a string if that string happened to be blank, and also a way to return a different string if the existing string is set. Here&#8217;s the solution I came up with which I placed in extras.rb in my lib directory (require &#8216;extras&#8217; in environment):</p>
<pre><code class="code_ruby">def otherwise(alternate, existing = nil)
    self == existing ? alternate : self
end</code></pre>
<p>I&#8217;m using it like so in my project:</p>
<pre><code class="code_xhtml">&lt;!-- If it's blank --&gt;
&lt;%= image_tag(image.general_filename('large'), :class =&gt; "full", :alt =&gt; (h image.description.otherwise(image.project.title))) %&gt;

&lt;!-- If it has a string you would like to replace --&gt;
&lt;%= image_tag(image.general_filename('large'), :class =&gt; "full", :alt =&gt; (h image.description.otherwise(image.project.title, "No description"))) %&gt;</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://orlandodefrias.com/2008/12/24/ruby-snippet-return-a-different-string-if-empty-or-if-replacing/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Image-based menu with CSS color property</title>
		<link>http://orlandodefrias.com/2008/12/10/image-based-menu-with-css-color-property/</link>
		<comments>http://orlandodefrias.com/2008/12/10/image-based-menu-with-css-color-property/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 17:11:53 +0000</pubDate>
		<dc:creator>Orlando</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[css menu]]></category>

		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://orlandodefrias.com/?p=12</guid>
		<description><![CDATA[I&#8217;ve been covering the image-based CSS menu now quite a bit, this being my third article of the sort. Menus are very important, and there&#8217;s so much that can be done with them that I figure I&#8217;d write an article on different variations to what is essentially the same menu. This article will cover something [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been covering the <a href="http://orlandodefrias.com/2008/07/10/image-based-menu-with-css/">image-based CSS menu</a> now quite a bit, this being my third article of the sort. Menus are very important, and there&#8217;s so much that can be done with them that I figure I&#8217;d write an article on different variations to what is essentially the same menu. This article will cover something which I consider to be extremely useful to designers who wish to make dynamically-colored menus using images rather than text.</p>
<p>For example, let&#8217;s say you have your standard menu with 4 links: Home, Locations, About, Contact. Maybe you want to color each link differently, one red, one blue, one green, one orange. The hover state for all of them will be&#8230; let&#8217;s say white. You can go ahead and make 4 images (home red, locations blue, about green, contact orange) and then 4 additional hover state images bringing your total to 8. Fair enough, it&#8217;s not really a tough task to undertake, though I can help you cut that time in half.</p>
<p>You show your client the menu and he loves it. You continue working on the rest of the site and a few days later the client frantically calls you and says, &#8220;we need to change the the menu IMMEDIATELY! Our competitor&#8217;s menu has the same colors, plus our logo designer decided to use different colors and we want them to match!&#8221;</p>
<p>This kind of thing happens all the time, and if you&#8217;re using images instead of browser-rendered text it can start taking up more and more time to recreate those images again.</p>
<p>Another example is a menu for a site that lets users choose a theme, or perhaps a seasonal change to the site&#8217;s colors. Rather than making images for each of the themes, use this method.</p>
<p>All right, enough anecdotes, let&#8217;s get right to it. Most of this markup and CSS is from the first article in the series which means you can just refer to that if you need in-depth explanations of what&#8217;s going on.</p>
<p>The markup:</p>
<pre><code class="code_xhtml">&lt;ul id="menu"&gt;
	&lt;li id="selected" class="home"&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;
	&lt;li class="locations"&gt;&lt;a href="#"&gt;Locations&lt;/a&gt;&lt;/li&gt;
	&lt;li class="about"&gt;&lt;a href="#"&gt;About Us&lt;/a&gt;&lt;/li&gt;
	&lt;li class="contact"&gt;&lt;a href="#"&gt;Contact Us&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</code></pre>
<p>Again, very short and sweet. The CSS is, for the most part, the same as the original with a slight variation which I&#8217;ll get to:</p>
<pre><code class="code_css">html {margin: 0; padding: 0;}
body {
	margin: 0;
	font-family: Arial;
	background-color: white;
	font-size: .75em;
	color: #333;
}
a:link {color: white; text-decoration: none; font-weight: bold;}
a:hover {color: #87acee;}

ul#menu {
	list-style: none;
	margin: 0;
	padding: 10px;
	height: 25px;
	background: #303136;
}
ul#menu li {
	float: left;
	display: inline;
	height: 25px;
	margin: 0 10px;

}
ul#menu li a {
	display: block;
	height: 25px;
	text-indent: -999em;
}

.home a {background:white url(images/menu_home.png) 0 0 no-repeat; width: 67px;}
.locations a {background: red url(images/menu_locations.png) 0 0 no-repeat; width: 119px;}
.about a {background: orange url(images/menu_about.png) 0 0 no-repeat; width: 115px;}
.contact a {background: green url(images/menu_contact.png) 0 0 no-repeat; width: 136px;}

.home a:hover, ul#menu li.locations a:hover,
.about a:hover, ul#menu li.contact a:hover {background-color: white;}</code></pre>
<p>As you can see it&#8217;s pretty much the same. The differences lie within the <em>background color</em> of the list item element in question. What we&#8217;re doing here is creating an image of the text with an alpha transparency.</p>
<p>This is what it would look like in Photoshop:</p>
<p><img src="http://orlandodefrias.com/examples/image-based-menu-color/step1/images/sample.png" alt="" /></p>
<p>You don&#8217;t need a hover state image since that will be controlled strictly through the CSS. What you need is the transparent image. If you don&#8217;t know how to make it, I&#8217;ll quickly show you how in Photoshop.</p>
<h4>Making the images</h4>
<p><strong>Step 1:</strong> Create a new layer (above the Background Layer) and give it the background color you&#8217;d like. I used #303136 for mine.<br />
<strong>Step 2:</strong> Switch to the background layer and either make it transparent or hide its layer visibility. The point is you cannot have a locked layer at the base.<br />
<strong>Step 3:</strong> Use the Type Tool and type out your menu word. Use a color that contrasts your background. I used #ffffff (white) for mine.<br />
<strong>Step 4:</strong> Rasterize the layer (right click the layer in the layers panel, click rasterize type) and open up the layer&#8217;s blending options by right clicking the layer in the panel and then clicking &#8220;Blending Options&#8230;&#8221;<br />
<strong>Step 5:</strong> In the advanced blending section of blending options, move the Fill Opacity slider to 0 and set the knockout to &#8220;shallow.&#8221;</p>
<p><img src="http://orlandodefrias.com/examples/image-based-menu-color/step1/images/making_font.png" alt="" /></p>
<p>That&#8217;s that. Crop it up to taste and save your file for web as PNG-24 (that&#8217;s important.) You can create the other menu item files in the same method.</p>
<p>Now when you want to change menu colors, you can do so in the CSS simply by changing the background-color, leaving the image intact, as such:</p>
<pre><code class="code_css">.your_item a {background: #56FD34 url(images/your_image.png) 0 0 no-repeat;}
.your_item a:hover {background-color: #9D14AB;}</code></pre>
<h4>What about IE6?</h4>
<p>As you might have noticed, IE6 doesn&#8217;t play nice with this on account of using alpha-transparent PNGs to achieve the anti-aliased text effect. In order to fix this while maintaining valid CSS you&#8217;ll need to use ActiveX but do so in an IE6-specific stylesheet using conditionals. Here is the CSS you&#8217;ll put in your IE6 stylesheet:</p>
<pre><code class="code_css">ul#menu li a {position: relative;} /*Fix IE6 link bug on PNGs*/
.home a {
	background-image: none;
	filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, src=images/menu_home.png, sizingMethod=image);
	cursor: pointer;
}
.locations a {
	background-image: none;
	filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, src=images/menu_locations.png, sizingMethod=image);
	cursor: pointer;
}
.about a {
	background-image: none;
	filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, src=images/menu_about.png, sizingMethod=image);
	cursor: pointer;
}
.contact a {
	background-image: none;
	filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, src=images/menu_contact.png, sizingMethod=image);
	cursor: pointer;
}</code></pre>
<p>We&#8217;re knocking out the background image on IE6 and replacing it with a Microsoft proprietary ActiveX filter. If you placed this in your IE stylesheet, you&#8217;ll need to tell the XHTML file to load it for IE6 only. Place the following inside your document&#8217;s &lt;head&gt; tags and replaced ie_styles.css with your stylesheet:</p>
<pre><code class="code_xhtml">&lt;!--[if lt IE 7]&gt;&lt;link href="ie_styles.css" media="screen" rel="stylesheet" type="text/css" /&gt;&lt;![endif]--&gt;</code></pre>
<p><a href="http://orlandodefrias.com/examples/image-based-menu-color/step1/index.html">View the complete menu</a></p>
<p>This kind of technique is something you can get used to putting together on all your image-based menus to make life much easier on you. I was very thorough in this tutorial, so while it may seem like a lot to do, it&#8217;s actually the kind of thing you can get done in mere minutes.</p>
]]></content:encoded>
			<wfw:commentRss>http://orlandodefrias.com/2008/12/10/image-based-menu-with-css-color-property/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Adding a drop down to our image-based CSS menu</title>
		<link>http://orlandodefrias.com/2008/12/08/adding-a-drop-down-to-our-image-based-css-menu/</link>
		<comments>http://orlandodefrias.com/2008/12/08/adding-a-drop-down-to-our-image-based-css-menu/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 23:40:37 +0000</pubDate>
		<dc:creator>Orlando</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[css menu]]></category>

		<category><![CDATA[drop downs]]></category>

		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://orlandodefrias.com/?p=11</guid>
		<description><![CDATA[Drop down menus are all the rage!
CSS drop down menus have been done before, so rather than reinvent the wheel, let&#8217;s use a tried-and-true CSS drop down menu method by Patrick Griffiths and Dan Webb aptly named the &#8220;Suckerfish Dropdown.&#8221; You can read more about it at A List Apart, a site with oodles and [...]]]></description>
			<content:encoded><![CDATA[<p>Drop down menus are all the rage!</p>
<p>CSS drop down menus have been done before, so rather than reinvent the wheel, let&#8217;s use a tried-and-true CSS drop down menu method by Patrick Griffiths and Dan Webb aptly named the &#8220;Suckerfish Dropdown.&#8221; You can read more about it at <a href="http://www.alistapart.com">A List Apart</a>, a site with oodles and even-more-oodley-oodles of web design articles.</p>
<p>What we&#8217;re going to be doing is integrating my previous <a href="http://orlandodefrias.com/2008/07/10/image-based-menu-with-css/">image-based CSS menu</a> with the Suckerfish drop down. It&#8217;s pretty easy. As always, first, the markup:</p>
<pre><code class="code_xhtml">&lt;ul id="menu"&gt;
		&lt;li id="selected" class="home"&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;
		&lt;li class="locations"&gt;&lt;a href="#"&gt;Locations&lt;/a&gt;
			&lt;ul&gt;
				&lt;li&gt;&lt;a href="#"&gt;Americas&lt;/a&gt;&lt;/li&gt;
				&lt;li&gt;&lt;a href="#"&gt;Asia&lt;/a&gt;&lt;/li&gt;
				&lt;li&gt;&lt;a href="#"&gt;Europe&lt;/a&gt;&lt;/li&gt;
				&lt;li&gt;&lt;a href="#"&gt;Africa&lt;/a&gt;&lt;/li&gt;
				&lt;li&gt;&lt;a href="#"&gt;Oceania&lt;/a&gt;&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li class="about"&gt;&lt;a href="#"&gt;About Us&lt;/a&gt;
			&lt;ul&gt;
				&lt;li&gt;&lt;a href="#"&gt;Company Profile&lt;/a&gt;&lt;/li&gt;
				&lt;li&gt;&lt;a href="#"&gt;Investors&lt;/a&gt;&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li class="contact"&gt;&lt;a href="#"&gt;Contact Us&lt;/a&gt;
			&lt;ul&gt;
				&lt;li&gt;&lt;a href="#"&gt;Online&lt;/a&gt;&lt;/li&gt;
				&lt;li&gt;&lt;a href="#"&gt;Phone&lt;/a&gt;&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;</code></pre>
<p>As you can see, the markup is identical to the image-based menu markup with the addition of a nested unordered list. That nested unordered list will be our drop down. It&#8217;s neater, more semantically relevant, and shorter than any Javascript solution you can think of, that&#8217;s for sure! Next up, the CSS:</p>
<pre><code class="code_css">html {margin: 0; padding: 0;}
body {
	margin: 0;
	font-family: Arial;
	background-color: white;
	font-size: .75em;
	color: #333;
}
a:link {color: white; text-decoration: none; font-weight: bold;}
a:hover {color: #87acee;}

ul#menu {
	list-style: none;
	margin: 0;
	padding: 10px;
	height: 25px;
	background: #303136;
}
ul#menu li {
	float: left;
	display: inline;
	height: 25px;
	margin: 0 10px;

}
ul#menu li a {
	display: block;
	height: 25px;
	text-indent: -999em;
}

.home a {background: url(images/menu_home.png) 0 0 no-repeat; width: 67px;}
.locations a {background: url(images/menu_locations.png) 0 0 no-repeat; width: 119px;}
.about a {background: url(images/menu_about.png) 0 0 no-repeat; width: 115px;}
.contact a {background: url(images/menu_contact.png) 0 0 no-repeat; width: 136px;}
.home a:hover, ul#menu li.locations a:hover,
.about a:hover, ul#menu li.contact a:hover {background-position: bottom left;}

ul#menu li#selected a {background-position: bottom left;}

/*Drop downs*/

ul#menu li ul li a {
	background-image: none;
	text-indent: 0;
	padding: 0 0 0 25px;
	height: auto;
	width: auto;
}
ul#menu li ul li {
	float: none;
	height: auto;
	display: block;
	margin: 0 0 10px 0;
}
ul#menu li ul li a:hover {
	background: url(images/pointer.png) 0 center no-repeat;
}

ul#menu li ul {
	display: none;
	position: absolute;
	top: 1em;
	width: 179px;
	padding: 15px 10px 0 10px;
	background: url(images/dropdown.png) left bottom no-repeat;
	left: 0;
	margin: 0;
}

ul#menu li&gt;ul {
	top: auto;
	left: auto;
}

ul#menu li:hover ul, ul#menu li.over ul {
	display: block;
	left: auto;
}
*:first-child+html ul#menu li:hover ul,
*:first-child+html ul#menu li.over ul {
	position: static;
}</code></pre>
<p>Let&#8217;s start breaking that down a little. Everything above the /*Drop downs*/ comment is from <a href="http://orlandodefrias.com/2008/07/10/image-based-menu-with-css/">this previous article</a>, so read that one if you&#8217;d like an explanation of what&#8217;s going on there.</p>
<p>The first snippet we&#8217;ll take a look at is the following:</p>
<pre><code class="code_css">ul#menu li ul li a {
	background-image: none;
	text-indent: 0;
	padding: 0 0 0 25px;
	height: auto;
	width: auto;
}
ul#menu li ul li {
	float: none;
	height: auto;
	display: block;
	margin: 0 0 10px 0;
}
ul#menu li ul li a:hover {
	background: url(images/pointer.png) 0 center no-repeat;
}</code></pre>
<p>What we&#8217;re doing here is resetting the properties set previously for the top-order unordered list. We&#8217;re wiping the background-image on the anchor which was used for the menu item image, resetting the text&#8217;s indent that took care of hiding plain text from the viewer, and resetting the height and width properties. Next, for the list item itself we&#8217;re removing the float property we previously used to simulate an inline list, resetting the height property, and adding some margins to the bottom just to space things out a bit.</p>
<p>Also, we&#8217;re adding in a little arrow pointing to the link you&#8217;re hovering. I guess I did that just because we can.</p>
<p>Next up is the drop down box itself:</p>
<pre><code class="code_css">ul#menu li ul {
	display: none;
	position: absolute;
	top: 1em;
	width: 179px;
	padding: 15px 10px 0 10px;
	background: url(images/dropdown.png) left bottom no-repeat;
	left: 0;
	margin: 0;
}

ul#menu li&gt;ul {
	top: auto;
	left: auto;
}</code></pre>
<p>This is where Suckerfish really comes in. What&#8217;s happening here is the drop down box is being hidden via display: none; and reset to an absolute position right below its list parent. The rounded corner is a simple background:</p>
<p><img src="http://orlandodefrias.com/examples/image-based-dropdown/step1/images/dropdown.png" alt="" /></p>
<p>Just place it on that nested unordered list attached to the BOTTOM of the element and it&#8217;ll resize itself accordingly, provided the drop down itself isn&#8217;t taller than the image (in which case you can make the image larger yourself), keeping the rounded corners at the bottom of the drop down.</p>
<p>To bring up the drop down menu when a user hovers over the menu item, that&#8217;s where the rest comes in:</p>
<pre><code class="code_css">ul#menu li:hover ul, ul#menu li.over ul {
	display: block;
	left: auto;
}
*:first-child+html ul#menu li:hover ul,
*:first-child+html ul#menu li.over ul {
	position: static;
}</code></pre>
<p>The reason for the &#8220;ul#menu li.over ul&#8221; is simple: IE6 doesn&#8217;t play nice with pseudo-classes. :hover will only work on anchors and nothing more. To remedy that, use the following snippet of Javascript for IE6:</p>
<pre><code class="code_javascript">startList = function() {
	if (document.all&amp;&amp;document.getElementById) {
		navRoot = document.getElementById("menu");
		for (i=0; i&lt;navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
window.onload=startList;</code></pre>
<p>This will add the &#8220;over&#8221; class to LI nodes within the &#8220;menu&#8221; ul, and remove them on mouse outs. While other compliant browsers will just simply use the li:hover method, IE6 will instead attach the &#8220;over&#8221; class which has the CSS property of the li:hover method, in effect giving it the same outcome.</p>
<p><a href="http://orlandodefrias.com/examples/image-based-dropdown/step1/index.html">View the drop down menu</a></p>
<p>That&#8217;s all it takes.<br />
<strong>UPDATE</strong>: Thanks John for pointing out the IE error. I&#8217;ve fixed it in the post, but the changes made were adding &#8220;left: auto;&#8221; to &#8220;ul#menu li:hover ul, ul#menu li.over ul {}&#8221; to set the position on hover, and also &#8220;margin: 0;&#8221; to &#8220;ul#menu li ul {}&#8221; to reset the margins on IE.</p>
]]></content:encoded>
			<wfw:commentRss>http://orlandodefrias.com/2008/12/08/adding-a-drop-down-to-our-image-based-css-menu/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to create a fixed overlay footer with CSS</title>
		<link>http://orlandodefrias.com/2008/11/23/how-to-create-a-fixed-overlay-footer-with-css/</link>
		<comments>http://orlandodefrias.com/2008/11/23/how-to-create-a-fixed-overlay-footer-with-css/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 00:36:03 +0000</pubDate>
		<dc:creator>Orlando</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[footers]]></category>

		<category><![CDATA[hacks]]></category>

		<category><![CDATA[IE conditionals]]></category>

		<guid isPermaLink="false">http://orlandodefrias.com/?p=10</guid>
		<description><![CDATA[I&#8217;ve seen various techniques on how to create footers sticking to the bottom of the screen which will expand downward if there&#8217;s enough content, but will remain stuck on the bottom of the screen if there isn&#8217;t. That&#8217;s useful for many sites, however if you want it to overlay above the rest of your content [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve seen various techniques on how to create footers sticking to the bottom of the screen which will expand downward if there&#8217;s enough content, but will remain stuck on the bottom of the screen if there isn&#8217;t. That&#8217;s useful for many sites, however if you want it to overlay above the rest of your content and remain fixed at the bottom of your screen even if there&#8217;s enough content to push it downward you&#8217;ll need another solution.</p>
<h4>The CSS</h4>
<pre><code class="code_css">html {margin: 0; padding: 0;}
body {
	margin: 0;
	padding: 0;
	font-family: Arial;
	background: white;
	font-size: .75em;
	color: #333;
}

#container {
	height: 1500px;
	overflow: hidden;
	margin: 0 auto;
	padding: 0 10px;
}

#footer {
	width: 100%;
	background: #ccc;
	position: fixed;
	z-index: 1;
	bottom: 0;
	padding: 10px;
}</code></pre>
<p>It&#8217;s easier than you might think, really. This works in Firefox, Safari, Opera, and IE7.</p>
<h4>The Problem</h4>
<p>As you might have guessed, this doesn&#8217;t work well with IE6. I&#8217;ve found that the easiest method to make it work, without having to go into quirk mode, is to use CSS expressions.</p>
<p>And a collective groan fills the air.</p>
<p>Yes, I know, I feel the same way about them, but in this case it works. We can put it in a CSS conditional statement so only IE6 reads and executes it. We can do it like this:</p>
<pre><code class="code_css">* html #footer {
	position: absolute;
	top:expression(eval(document.compatMode &amp;&amp;
		document.compatMode=='CSS1Compat') ?
		documentElement.scrollTop
		+(documentElement.clientHeight-this.clientHeight)
		: document.body.scrollTop
		+(document.body.clientHeight-this.clientHeight));
}</code></pre>
<p>You can <a href="/examples/overlay-footer/index.html">view the example</a> to see the footer in action.</p>
<p>This works and solves the problem. We&#8217;re not done yet, though. If you want your page to validate, which you probably should, you&#8217;ll need to take that out of your stylesheet and place it in an IE6-specific stylesheet to avoid 2 errors. In order to do so, create a separate stylesheet and call it ie6_styles.css, or whatever you want. Then, after linking your base sheet, add this to your markup:</p>
<pre><code class="code_xhtml">&lt;!--[if lt IE 7]&gt;
&lt;link href="/stylesheets/ie6_styles.css" media="screen" rel="Stylesheet" type="text/css" /&gt;
&lt;![endif]--&gt;</code></pre>
<p>That statement is saying &#8220;If the IE version is below 7, process the markup enclosed within these tags&#8221;, which means it it loads the ie6_styles.css stylesheet. Validation parsers such as the <a href="http://jigsaw.w3.org/css-validator/">W3C CSS Validator</a> don&#8217;t read through conditional statements so everything will validate nicely.</p>
]]></content:encoded>
			<wfw:commentRss>http://orlandodefrias.com/2008/11/23/how-to-create-a-fixed-overlay-footer-with-css/feed/</wfw:commentRss>
		</item>
		<item>
		<title>IE unordered list extra space bug</title>
		<link>http://orlandodefrias.com/2008/11/23/ie-unordered-list-extra-space-bug/</link>
		<comments>http://orlandodefrias.com/2008/11/23/ie-unordered-list-extra-space-bug/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 08:51:56 +0000</pubDate>
		<dc:creator>Orlando</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[ie6 bugs]]></category>

		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://orlandodefrias.com/?p=9</guid>
		<description><![CDATA[I was working on converting a client&#8217;s design into XHTML/CSS when I encountered something I SHOULD have faced long ago, but never did on account of my recent change in CSS practice. Since early this week, I&#8217;ve been starting new projects with a reset stylesheet to make my life a little easier and manage my [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on converting a client&#8217;s design into XHTML/CSS when I encountered something I SHOULD have faced long ago, but never did on account of my recent change in CSS practice. Since early this week, I&#8217;ve been starting new projects with a reset stylesheet to make my life a little easier and manage my time more efficiently. Anyway, onto the problem.<br />
 </p>
<h4>The problem</h4>
<p>After completing the site, I checked in IE6 only to realize all my unordered [block] list menus had some odd extra space to the left. In other words, they had phantom indentations. The padding, margin, and indents were reset to 0, so I couldn&#8217;t figure out what the problem was. The list-style was also set to none. Googling produced a lot of people having the same issue, but no actual solutions in about 15 minutes of browsing. Stripped down and showing only relevant bits, this is the CSS I had in place:</p>
<pre><code class="code_css">* {margin: 0; padding: 0;}
ul, ol, li {list-style: none;}</code></pre>
<p>The markup was straightforward:</p>
<pre><code class="code_xhtml">&lt;ul id="whoCares"&gt;
	&lt;li&gt;&lt;a href="#"&gt;A link&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="#"&gt;A link&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="#"&gt;A link&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</code></pre>
<h4>The solution</h4>
<p>Utterly, painfully simple.</p>
<pre><code class="code_css">ul, ol, li {list-style-position: outside; list-style: none;}</code></pre>
<p> </p>
<p>That damn list-style-position. It almost makes you want to punch yourself.</p>
]]></content:encoded>
			<wfw:commentRss>http://orlandodefrias.com/2008/11/23/ie-unordered-list-extra-space-bug/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SHOWN&#8217;D - Showcase your stuff.</title>
		<link>http://orlandodefrias.com/2008/11/21/shownd-showcase-your-stuff/</link>
		<comments>http://orlandodefrias.com/2008/11/21/shownd-showcase-your-stuff/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 04:12:43 +0000</pubDate>
		<dc:creator>Orlando</dc:creator>
		
		<category><![CDATA[My sites/apps]]></category>

		<category><![CDATA[Quick posts]]></category>

		<category><![CDATA[shownd]]></category>

		<category><![CDATA[web apps]]></category>

		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://orlandodefrias.com/?p=8</guid>
		<description><![CDATA[So the latest project I&#8217;ve been working on is finally ready for prime time. SHOWN&#8217;D is a resource for creative professionals. It allows them to set up an online portfolio and connect with employers.

I like how it turned out in the design department, and early users seem to be reporting pretty pleasant experiences with the [...]]]></description>
			<content:encoded><![CDATA[<p>So the latest project I&#8217;ve been working on is finally ready for prime time. SHOWN&#8217;D is a resource for creative professionals. It allows them to set up an online portfolio and connect with employers.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://image.cssbased.com/img/shownd.com_1227160019218.jpg" alt="SHOWN'D" width="270" height="199" /></p>
<p>I like how it turned out in the design department, and early users seem to be reporting pretty pleasant experiences with the usability of it. I put a lot of focus on the interface, so I&#8217;m glad to hear that. I&#8217;m still hot fixing and adding things here and there, but the app is deployed and ready for use. The front page is something I&#8217;ve been going back-and-forth on this past week. The way I want to have it (which is how it looks while logged in, sans the intro header) I will probably add when we get some employers posting jobs since right now it&#8217;s a bit empty and doesn&#8217;t give it the right look.</p>
<p>Anyway, just wanted to post this update. This probably also explains my lack of posts lately. I&#8217;d like to keep adding some more CSS tips, so hopefully I can get back to that soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://orlandodefrias.com/2008/11/21/shownd-showcase-your-stuff/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
  
