<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" 
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:admin="http://webns.net/mvcb/"
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
	
	<channel>
    
		<title><![CDATA[Thoughts & Tales]]></title>
		<link>http://leihu.com/thought/</link>
		<description></description>
		<dc:language>en</dc:language>
		<dc:creator>jmathias@leihu.com</dc:creator>
		<dc:rights>Copyright 2011</dc:rights>
		<dc:date>2011-05-25T18:29:15+00:00</dc:date>
		<admin:generatorAgent rdf:resource="http://expressionengine.com/" />

		
			<item>
				<title><![CDATA[Procrastination Zero]]></title>
				<link>http://leihu.com/thought/entry/procrastination-zero</link>
				<guid>http://leihu.com/thought/entry/procrastination-zero</guid>
				<description><![CDATA[<p>I was tele-communicating with a co-worker today, and we got on the topic of &#8220;Inbox Zero&#8221; and being on top of things, or trying to be. </p>

<p>I&#8217;m not a fan of &#8220;Inbox Zero&#8221; or &#8220;E-mail Bankruptcy&#8221; or &#8220;Getting Things Done&#8221;. I feel they all add an extra unnecessary step/series of steps to the end goal of accomplishing things. Maybe, I&#8217;m too old school, or too efficient at multitasking but the idea of writing a list of things to do before actually doing those things causes my brain to start doing increasingly dangerous stunts without a stunt coordinator.</p>

<p>I want to introduce you to a new name for a concept I&#8217;ve been using forever, I call it.</p>

<p><strong>Procrastination Zero</strong>.</p>

<p>It&#8217;s the simplest plan of all time, it has a single rule and it works. I&#8217;ve been utilizing it for seven years now&#8212;albeit without a fancy name.</p>

<p><strong>The Rule</strong>: <em>When something needs to be done, do it</em>.</p>

<p>&#8220;Well Jim.&#8221; You say, &#8220;That sounds too easy to be true, I can&#8217;t just do things as they come up. I&#8217;m a busy person!!&#8221;</p>

<p>I know. Me too. Always. Yet, for some inexplicable reason doing things when they come up <em>always</em> keeps me ahead of the curve. Crazy-talk I know!</p>

<p><strong>Hey, how does this work?</strong></p>

<p>As I said earlier. You just do things as they come up. Simple. You don&#8217;t write things down, you don&#8217;t put things off until tomorrow. You just do them. Right away.</p>

<p><strong>But I don&#8217;t have all the info/stuff I need to finish the task!</strong></p>

<p>Which means you don&#8217;t have a task then. Isn&#8217;t that odd? Basically if someone tells you about something they need done, but they can&#8217;t get you all the info/stuff to do it until Wednesday, then you have not been assigned/given a task at all. And it can wait until Wednesday when the task is actually available to do, but do it as soon as it&#8217;s ready to go.</p>

<p><strong>Wait! I don&#8217;t have time to do things as they come up, I&#8217;m swamped.</strong></p>

<p>Right&#8230; Two things are happening here. One; You&#8217;re a liar and probably a dirty procrastinator as well (only slightly kidding). Two; You&#8217;re honest, but also have a problem saying no. Which is why you&#8217;ve accepted more tasks than you can actually accomplish (I&#8217;ve finally stopped doing this to myself).</p>

<p>To solve this problem, simply stop lying and procrastinating. Or in the second more probable use case, start saying no. Firmly but, politely. It&#8217;s real easy, the work still needs to get done, it&#8217;ll just be more graciously distributed, easing your mind and work load quite a lot.</p>

<p><strong>But I have 1000 e-mails from the last month in my Inbox.</strong></p>

<p>Really? You sure? Try using a junk filter. If in the very uncommon case that you are buried in legitimate e-mails, try answering them as they come in. You&#8217;re not required to write a novel or even a novella for e-mail communications. The point is to be fast, if your correspondents need to wait a week or longer to hear back from you they&#8217;d have been better off using traditional mail.</p>

<p>The average e-mail can be answered in less than 30 seconds, and 3 sentences. Anything that takes more thought or a longer response should have the following reply sent; &#8220;Hi Name, Let&#8217;s schedule a phone call to discuss this. When is good for you?&#8221; </p>

<p>Phone calls can cover a lot of info in a short period, plus a real voice and tone go a long way to squashing time-wasting miscommunications. Is the other party too busy for a phone call? Link them to this article, they need it.</p>

<p>So that&#8217;s it. Start today!</p>

<p>Procrastination Zero! Guess what you&#8217;re done!</p>]]></description>
				<dc:subject><![CDATA[Opinion, Writing,]]></dc:subject>
				<dc:date>2012-01-29T00:39:28+00:00</dc:date>
			</item>
		
			<item>
				<title><![CDATA[One Sentence]]></title>
				<link>http://leihu.com/thought/entry/one-sentence</link>
				<guid>http://leihu.com/thought/entry/one-sentence</guid>
				<description><![CDATA[<p>My dad died. He was 57, he fought cancer and cancer won. </p>

<p>The Reno Gazette gave him a single sentence. One sentence. Fifty-seven years distilled into a single series of small facts. Surely this is not what becomes of us after we leave our bodies. Just a small inconsequential sentence in a small paper in our current town.</p>

<p>He wasn&#8217;t the best man to ever live, but he was nowhere near the worst, and so I thought I might give him a few more words in remembrance. And you gentle reader, if you could be so inclined, maybe you could say a small prayer for the man, so that he can rest in peace and move onto the next.</p>

<p>Dale Allen Mathias, was born in Germany, on a US Army base. He lived in Kentucky for a time. California most of his life, Arizona for a short period and he died in Reno Nevada. He had a younger brother Glen and an older Sister Lee. He attended high school in Oakland California about which he once told me, as one of very few white kids at school, &#8220;You put your stuff in your locker, look both ways and run.&#8221; This was the man&#8217;s humor. </p>

<p>He met Michelle &#8220;Mik&#8221; McClain in a pool hall in the 1970&#8217;s. Together they had me James Allendale, then married. After they moved out of Oakland and into Quincy, California my sisters Magdalena Ayn and Sarah Adalea followed. I went to kindergarten in Quincy, I fell down the stairs with my mom, broke my nose in the backyard, I cried as hard as my mom did on my first day of kindergarten and I remember my dad left me a note about how proud he was of me and that he loved me. Back then he was my hero.</p>

<p>He loved fish. He loved science. He was strong and capable and brilliant. He once saved a fish from certain death, by preforming surgery on it, he made the papers, he was the Fish Doctor. He was funny, though often crude. He always provided, we weren&#8217;t rich, but we were fed and clothed and always sheltered. He loved us. I loved him.</p>

<p>He wasn&#8217;t the best dad. He had flaws and anger issues, he was an alcoholic and drug addict, he spent time in jail and rehab. I hadn&#8217;t spoken to him in nearly ten years when I found out he was sick. </p>

<p>I called him, he answered and he told me about how jail had changed him and he was clean, he sounded proud, I was happy to hear it. He was on his way to get some Angel fish, he loved fish. </p>

<p>I told him I forgave him, I said to him &#8220;I miss you old man.&#8221; He choked up and returned the sentiment. </p>

<p>You see, even when I stopped speaking to him, even when he did bad things and wrong things, even at his worst, he was my dad. That hero from thirty-two years earlier, the man that always carried a recent picture of me in his wallet, the proud grandfather that never treated my wife with anything but love and respect. The man that took my entire family in, providing shelter, and food and money for not just me, but all three of us when I had my own personal demons surface at twenty-four.</p>

<p>My Dad taught me to be a man, through example. He taught me work ethic, responsibility, and how to provide. He taught me to learn everything I could, how to b.s. with the best of them. He taught me all kinds of bad habits and traits as well, but without them and him, I certainly wouldn&#8217;t be the man I am today, and I know at least four people that really love the man I&#8217;ve become.</p>

<p>Dad, I never stopped loving you. And I will always miss you, and I hope in our next lives we get to hang out.</p>]]></description>
				<dc:subject><![CDATA[Non-Fiction, Open Letter, Personal,]]></dc:subject>
				<dc:date>2011-11-10T23:49:49+00:00</dc:date>
			</item>
		
			<item>
				<title><![CDATA[Executive Decisions]]></title>
				<link>http://leihu.com/thought/entry/executive-decisions</link>
				<guid>http://leihu.com/thought/entry/executive-decisions</guid>
				<description><![CDATA[<p>&#8220;We&#8217;ve decided to rescind the Creative Director position offer. Heart breaking, I know.&#8221;</p>

<p>My heart stopped.</p>

<p>I was in the parking lot at Pike&#8217;s Market in Seattle. I had just received an email from EllisLab and was reading it on my iPhone. The above was the first line I read. It was followed by a paragraph of why.</p>

<p>I could not breathe.</p>

<p>The day before I had given notice at Amazon. I had told them I was leaving to be the Creative Director at EllisLab, the result of a month long journey that included soul searching, mind wrestling and creating my first Key Note presentation, that I was not able to present with the animations and panache I had practiced.</p>

<p>I scrolled down.</p>

<p>The first sentence of the second paragraph was&#8230; &#8220;Instead, I&#8217;d like to offer you the position of Chief Creative Officer at EllisLab.&#8221;</p>

<p>The air I had lost, came rushing back in a wave of emotions.</p>

<p>This was it, the big time. The culmination of my eleven year journey from kitchen table to CCO of the company that makes the very software that built the site you&#8217;re reading, and many more like it before, and many more to come.</p>

<p>Tears began to roll into my giant moustache.</p>

<p>I turned to my wife, and I read aloud the first sentence, she began yelling &#8220;No! No! No!&#8221; and grasped my arm, repeating &#8220;No!&#8221; I began reading the second paragraph and choked up, tears burst forth and my throat locked. I handed her my phone and she finished reading the offer email out loud to the boys and I.</p>

<p>I could feel the car swelling with pride.</p>

<p>Eleven years ago when I got laid off from Les Schwab in Portland, so soon after having our second son. I promised my wife, that if she supported me at trying to make web design work for us by starting my own business, that she and my sons would never want for anything again. I would provide for them the life they deserved. We deserved. You see I knew all along, that web is what I was supposed to be doing with my life.</p>

<p>Amy, Liam, Bryce, Cameron. I started this journey for them and me, I stayed the course for a promise I made.</p>

<p>I&#8217;ve dragged them all over the country, following my career, trying to get to the point where I would be leading the design charge, not just pushing pixels and painting screens. Where I could have the best of both worlds. Somewhere I could make an impact on the community I love.</p>

<p>EllisLab stepped up, and offered to take a chance on this humble man, and not unlike my family, I&#8217;m not going to let them or the community down.</p>

<p>This is where I bring the DazzleThunder.</p>]]></description>
				<dc:subject><![CDATA[Design, Development, Personal,]]></dc:subject>
				<dc:date>2011-05-25T18:29:15+00:00</dc:date>
			</item>
		
			<item>
				<title><![CDATA[Fool me, lose the sale]]></title>
				<link>http://leihu.com/thought/entry/fool-me-lose-the-sale</link>
				<guid>http://leihu.com/thought/entry/fool-me-lose-the-sale</guid>
				<description><![CDATA[<p>So against my better judgment I spent two hours in the cold and rain on Friday evening, waiting in the longest queue of my life for the privilege to hand a hard-earned, crisp one-thousand dollars to some dipwad in a blue tee shirt with a small, white, half-eaten apple upon it.</p>

<p>During the wait, I asked the same Apple employee four times, to please just be honest and save me the trouble of standing here, with my whole family if I&#8217;m not going to be able to purchase an iPad. All four times he said there was &#8220;plenty to go around&#8221;, to be fair the third and fourth time he added, &#8220;so long as you don&#8217;t want a white 3g at&amp;t model&#8221; and &#8220;if you don&#8217;t mind a black Verizon model&#8221; respectively.</p>

<p>In line, I stayed. I was twenty people from the entrance, when the same dude came out and said, &#8220;Really sorry, but we only have 10 left, and it is 2 per person, so&#8230;&#8221; At this point I was pretty pissed. This guy had wasted my family and I&#8217;s time. The realization that they knew exactly how many there were the whole time, and that more than half the line was going home empty handed, and in fact they had lied to everyone, keeping the line as long and crazy as they could, made my anger even worse.</p>

<p>It&#8217;s not about getting an iPad or not. It&#8217;s about a company knowingly wasting my time and even when pressed and taken aside and asked for a legit answer telling me, &#8220;it&#8217;s NO problem&#8221;.</p>

<p>So I left the line after thanking the kid for wasting my time. He was of course, mock offended.</p>

<p>I also let the rest of the line behind me know that the iPads were all gone. Because there was NO way that the last 10 wouldn&#8217;t be purchased by the next 20 people, let alone and more likely the next five people. It was very funny, watching the guy and his coconspirators try to run damage control after my announcement.</p>

<p>I went home, looked on craigslist and realized why that group of kids I saw leaving the Apple store 2 hours earlier each had four iPads with them. Aftermarket sales for the $499 model for $1000!</p>

<p>I called another Apple store, spoke to a manager and he said, we are getting more tomorrow (Saturday) at 11am, if you call I&#8217;d be happy to hold one while you drive down, to make up for the debacle at the launch line.</p>

<p>I called at 11am, asked for the manager and got a different manager who told me, no iPads today, sorry, but we are getting a secret shipment tomorrow at, yes you guessed it, 11am. Call back then and I&#8217;ll be happy to hold one while you drive down, no problem. She too felt sorry for me after I told her my story.</p>

<p>So this morning I call at 11am. Guess what, yeah no iPads, but yet another manager. This one says no way we get any shipments on a Sunday, how silly of me for believing someone who works somewhere I don&#8217;t. He goes on to say we will be getting more tomorrow (Monday) at 11am, and that they had gotten some on Saturday at 11am. Wait, that&#8217;s strange I was told they didn&#8217;t get any Saturday by Saturday&#8217;s manager.</p>

<p>At this point, I realize what a fool I&#8217;d been over a hunk of metal and glass. I simply said. &#8220;You lost a sale, thank you for wasting my time.&#8221; I heard, &#8220;But, wait&#8230;&#8221; before I ironically pressed end on my iPhone 3GS.</p>]]></description>
				<dc:subject><![CDATA[Entertainment, Non-Fiction, Opinion, Personal,]]></dc:subject>
				<dc:date>2011-03-13T20:01:02+00:00</dc:date>
			</item>
		
			<item>
				<title><![CDATA[Fifty Three]]></title>
				<link>http://leihu.com/thought/entry/fifty-three</link>
				<guid>http://leihu.com/thought/entry/fifty-three</guid>
				<description><![CDATA[<p>You are looking at the fifty third version of this website.</p>

<p>I wanted to redesign, as the fifty second version wasn&#8217;t my bag of tea. I&#8217;m not sure this one is perfect enough either, but I want to start writing and drawing again, and this will have to do. for now.</p>

<p>New brand? Yes the text brand is new, I think it really fits the idea of artist, writer &amp; outlaw. I heart it.</p>

<p>No Septapus? Sort of, he&#8217;s not gone, just hiding ;)</p>

<p>Where is the search? Coming back soon, I just want to do something different with it, so it&#8217;s still in development, truth is the content here is not deep enough, yet to really need it, so it was low priority and not a launch blocker.</p>

<p>I hate it! Sorry, but if I&#8217;m being honest, this site is mostly for me, and if you really hate it that much, wait a year, I promise it&#8217;ll be different again.</p>

<p>Thanks for stopping by, I hope to see you back again soon.</p>]]></description>
				<dc:subject><![CDATA[Design, Development, Personal,]]></dc:subject>
				<dc:date>2011-03-06T21:11:50+00:00</dc:date>
			</item>
		
			<item>
				<title><![CDATA[Hiatus]]></title>
				<link>http://leihu.com/thought/entry/hiatus</link>
				<guid>http://leihu.com/thought/entry/hiatus</guid>
				<description><![CDATA[<p>I&#8217;m lying in bed, on Thanksgiving eve.</p>

<p>I have everything in the world to be thankful for. A new job, a new adventure, a new city, my wife of 14 years, my three sons, a roof over my head, a roof waiting to cover me in Seattle, friends, family and a multitude of other things, big, small and in between.</p>

<p>The blog has been quiet the last few weeks, because of this giant undertaking of moving across the country for the second time, in three years. leihu will continue to be quiet for another couple of weeks as I travel and unload and settle in at my new gig and in my new house.</p>

<p>I will be back with three more installments of CSS 101, and then I will be starting a new basics series on ExpressionEngine development. Additionally I&#8217;m going to start writing a serial novella one chapter at a time here on leihu.</p>

<p>So until we meet again, I must resolve this burst with good tidings to you and yours.</p>

<p>Love, James.</p>]]></description>
				<dc:subject><![CDATA[Personal,]]></dc:subject>
				<dc:date>2010-11-25T03:49:48+00:00</dc:date>
			</item>
		
			<item>
				<title><![CDATA[So Long and Thanks for all the Fish]]></title>
				<link>http://leihu.com/thought/entry/so-long-and-thanks-for-all-the-fish</link>
				<guid>http://leihu.com/thought/entry/so-long-and-thanks-for-all-the-fish</guid>
				<description><![CDATA[<p>In the middle of summer 2008 my family and I left our home in the extreme northern tip of the Idaho panhandle on a five day adventure that took us twenty-one-hundred miles across nine states and through some of the hottest, most stress-filled days of our lives to arrive in Spring Hill, Tennessee which was our home for the next year until we moved again to Nashville, TN this time it was only thirty-five miles, but it cut my daily commute from two hours down to forty minutes and it allowed us to live a fuller life in the year and almost one half since.</p>

<p>My time in Nashville, and even those twelve long months in Spring Hill have been the best of my life so far, well, you know barring the births of my sons, meeting my best friend and wife forever, my first kiss/car/beer, you get the gist. I love Tennessee, it has been home, and it will always hold a piece of my larger than average, but quite normally sized for my height, heart. I will miss a lot of things and people and places within this great state. For the first time in a long while I have friends I&#8217;ll miss dearly and connections to a place that I can&#8217;t just turn and walk away from.</p>

<p>In Tennessee, I found family, not blood family, but better. I found Jesus. I found myself and I found Magic again.</p>

<p>There comes a time for everything, that marks it&#8217;s end. The end of our time in Nashville, and the south draws near. On November 28th, Amy, Liam, Bryce, Cameron, our pets and I, will get into our 2004 Dodge Dakota, and make another long journey to a new horizon. This time the trip will include eight days, seven states, thirty-four-hundred-miles and hopefully less stress.</p>

<p>We&#8217;re moving to Seattle, WA.</p>

<h2>Why Come?</h2>

<p>In July of this year, I realized that I had made a grave mistake in leaving Paramore|Redd for what seemed like greener pastures in a work from home remotely gig out of San Francisco. I was quite unhappy, and I wasn&#8217;t being challenged creatively or intellectually, it was not my new job&#8217;s fault, not anyone&#8217;s fault, it was just me. I had made a mistake. I began a search.</p>

<p>I tried finding a job locally, it was our goal to stay local, in Tennessee. Nobody had a place for me. I slowly figured out that I was a living catch 22, I had a skill set and experience level that everyone wanted, but no one was able or willing to pay for. Again, no one at fault here, just bad timing in a small market. I widened my search.</p>

<p>Once I was looking outside Tennessee a lot of opportunities opened. I was offered a job in Illinois, with a fantastic group of guys, I turned it down only because after visiting and discussion my wife and sons weren&#8217;t interested in moving to Illinois. Sometimes I regret not taking that job, if only because it sure would have been fun to work there.</p>

<p>I was taking daily phone interviews at this point, some turned into second phone interviews, others faded away. Two turned into fly in and meet and interview in person deals. Both were in Seattle. After interviewing on separate occasions, yes two different trips to the Emerald City, I was offered both jobs, not at the same time, mind you but close enough together that a decision between them had to be made.</p>

<p>Both jobs were generous and amazing offers to work on incredible and famous projects. Both jobs were in Seattle, a place my family was interested in moving to, and both jobs offered amazing salaries and benefits packages and people to work with.</p>

<p>One job however offered me something the other didn&#8217;t, the opportunity to move my skill set and knowledge forward, a way to grow as a designer and developer. So I made two calls.</p>

<p>I accepted a position with Amazon. I am going to be a Senior UX Designer for the Shelfari/Kindle team. I start December 13th.</p>

<p>I&#8217;m really excited, but also a bit scared. Amazon&#8217;s interview process was the hardest interview of my life. If this job is half as challenging as the interview and pushes me where I&#8217;m sure it will, I&#8217;ll come out the other end with a wealth of new knowledge about my craft and art.</p>

<h2>It&#8217;s not goodbye&#8230;</h2>

<p>It&#8217;s just so long. I&#8217;ll be back around to visit and I&#8217;ll be on the twitters and the facebooks and some of you have my phone number; call, text, write me an email. </p>

<p>Thanks for all the fish.</p>]]></description>
				<dc:subject><![CDATA[Personal,]]></dc:subject>
				<dc:date>2010-11-07T00:07:27+00:00</dc:date>
			</item>
		
			<item>
				<title><![CDATA[What&#8217;s on the Menu?]]></title>
				<link>http://leihu.com/thought/entry/whats-on-the-menu</link>
				<guid>http://leihu.com/thought/entry/whats-on-the-menu</guid>
				<description><![CDATA[<p>Website navigation or menus if you will are an important, no required feature of every website. In one way or another there is going to be some grouping of hierarchical links to related or alternate pages within a directory. But, what is the best way to create a menu? Whether it be horizontal or vertical a navigation menu should always start out the same way.</p>

<p>The HTML base of a navigational menu is often represented with a unordered list <code><span class="syntax-element">&lt;ul&gt;</span></code>, like so.<br /></p><div class="codeblock">
<pre><code>
<span class="syntax-element">&lt;ul <span class="syntax-id">id=&quot;primary-navigation&quot;</span>&gt;</span>
	<span class="syntax-element">&lt;li&gt;&lt;a href=&quot;&quot; title=&quot;&quot;&gt;</span>menu item one<span class="syntax-element">&lt;/a&gt;&lt;/li&gt;</span>
	<span class="syntax-element">&lt;li&gt;&lt;a href=&quot;&quot; title=&quot;&quot;&gt;</span>menu item two<span class="syntax-element">&lt;/a&gt;&lt;/li&gt;</span>
	<span class="syntax-element">&lt;li&gt;&lt;a href=&quot;&quot; title=&quot;&quot;&gt;</span>menu item three<span class="syntax-element">&lt;/a&gt;&lt;/li&gt;</span>
	<span class="syntax-element">&lt;li&gt;&lt;a href=&quot;&quot; title=&quot;&quot;&gt;</span>menu item four<span class="syntax-element">&lt;/a&gt;&lt;/li&gt;</span>
<span class="syntax-element">&lt;/ul&gt;</span></code></pre>
</div><!-- /.codeblock -->

<p>The use of an unordered list is debatable, but in my opinion an unordered list is more logical than an ordered list, because we are not always going be leaving the menu items in order. And more reasonable than a definition list, because we are not defining a list of anything, we are merely listing navigational items, however, that being said, if you were to have a more complex menu with additional text, for instance, &#8220;About Us - All About The Company and Team&#8221; that would be a good case for using a definition list.</p>

<p>Since we are discussing beginners topics in CSS 101, I am going to keep this super simple and only talk about best practices for horizontal and vertical menus in terms of CSS code, not visual design.</p>

<h2>The Horizon</h2>

<p>Horizontal menus are quite common and are terrific for creating site wide menus of potential locations within your website. Unfortunately, they are often limited to a set width and therefore can be a bad choice for heavy navigational websites. It is always best practice to have a small amount of primary navigation, but the reality is that often clients and audiences require a great deal more than will fit in a single horizontal navigation.</p>

<p>By default an unordered list stacks vertically in a browser, and we need the list items to sit next to each other horizontally, how might we achieve this?</p>

<p><a href="http://leihu.com/thought/entry/floats-you" title="Floats &amp; You">Floats</a> of course!!</p>

<p>The CSS for the above HTML, to create a horizontal menu should look something like this</p>

<div class="codeblock">
<pre><code>
<span class="syntax-id">#primary-navigation</span>{
	<span class="syntax-attribute">list-style-type:</span> none;
	<span class="syntax-attribute">margin:</span> 0;
}

	<span class="syntax-id">#primary-navigation</span> <span class="syntax-element">li</span>{
		<span class="syntax-attribute">float:</span> left;
		<span class="syntax-attribute">margin-right:</span> 5px;
	}
	
		<span class="syntax-id">#primary-navigation</span> <span class="syntax-element">a</span><span class="syntax-psuedo">:link</span>,
		<span class="syntax-id">#primary-navigation</span> <span class="syntax-element">a</span><span class="syntax-psuedo">:visited</span>{
			<span class="syntax-attribute">background-color:</span> #EEEEEE;
			<span class="syntax-attribute">color:</span> #FF0000;
			<span class="syntax-attribute">display:</span> block;
			<span class="syntax-attribute">padding:</span> 10px;
		}
	
		<span class="syntax-id">#primary-navigation</span> <span class="syntax-element">a</span><span class="syntax-psuedo">:hover</span>,
		<span class="syntax-id">#primary-navigation</span> <span class="syntax-element">a</span><span class="syntax-psuedo">:active</span>{
			<span class="syntax-attribute">background-color:</span> #FF0000;
			<span class="syntax-attribute">color:</span> #FFFFFF;
		}</code></pre>
</div><!-- /.codeblock -->

<p><img class="center" src="/content/img/horizontal-menu.gif" alt="horizontal menu example"></p>

<p>Because we have floated the list items, we need to clear those floats, if you remember from <a href="http://leihu.com/thought/entry/floats-you" title="Floats &amp; You">Floats &amp; You</a>, we can do this using the <code><span class="syntax-psuedo">:after</span></code> method by applying a new class to our HTML menu, like this.</p>

<div class="codeblock">
<pre><code>
<span class="syntax-element">&lt;ul <span class="syntax-id">id=&quot;primary-navigation&quot;</span> <span class="syntax-class">class=&quot;float-clear&quot;</span>&gt;</span>
	<span class="syntax-element">&lt;li&gt;&lt;a href=&quot;&quot; title=&quot;&quot;&gt;</span>menu item one<span class="syntax-element">&lt;/a&gt;&lt;/li&gt;</span>
	<span class="syntax-element">&lt;li&gt;&lt;a href=&quot;&quot; title=&quot;&quot;&gt;</span>menu item two<span class="syntax-element">&lt;/a&gt;&lt;/li&gt;</span>
	<span class="syntax-element">&lt;li&gt;&lt;a href=&quot;&quot; title=&quot;&quot;&gt;</span>menu item three<span class="syntax-element">&lt;/a&gt;&lt;/li&gt;</span>
	<span class="syntax-element">&lt;li&gt;&lt;a href=&quot;&quot; title=&quot;&quot;&gt;</span>menu item four<span class="syntax-element">&lt;/a&gt;&lt;/li&gt;</span>
<span class="syntax-element">&lt;/ul&gt;</span></code></pre>
</div><!-- /.codeblock -->

<p>Horizontal menu, not so hard, well guess what, vertical is even easier!</p>

<h2>Vertically Challenged</h2>

<p>First, we don&#8217;t need <code><span class="syntax-class">.float-clear</span></code> or floats at all. Starting with the original HTML above, we can use the following CSS to make this a vertical menu.</p>

<div class="codeblock">
<pre><code>
<span class="syntax-id">#primary-navigation</span>{
	<span class="syntax-attribute">list-style-type:</span> none;
	<span class="syntax-attribute">margin:</span> 0;
	<span class="syntax-attribute">mwidth:</span> 220px;
}

	<span class="syntax-id">#primary-navigation</span> <span class="syntax-element">li</span>{ <span class="syntax-attribute">margin-right:</span> 5px; }
	
		<span class="syntax-id">#primary-navigation</span> <span class="syntax-element">a</span><span class="syntax-psuedo">:link</span>,
		<span class="syntax-id">#primary-navigation</span> <span class="syntax-element">a</span><span class="syntax-psuedo">:visited</span>{
			<span class="syntax-attribute">background-color:</span> #EEEEEE;
			<span class="syntax-attribute">color:</span> #FF0000;
			<span class="syntax-attribute">display:</span> block;
			<span class="syntax-attribute">padding:</span> 10px;
		}
	
		<span class="syntax-id">#primary-navigation</span> <span class="syntax-element">a</span><span class="syntax-psuedo">:hover</span>,
		<span class="syntax-id">#primary-navigation</span> <span class="syntax-element">a</span><span class="syntax-psuedo">:active</span>{
			<span class="syntax-attribute">background-color:</span> #FF0000;
			<span class="syntax-attribute">color:</span> #FFFFFF;
		}</code></pre>
</div><!-- /.codeblock -->

<p><img class="right" src="/content/img/vertical-menu.gif" alt="vertical menu example"> </p>

<p>See what I did there? Let me explain, first I gave the menu a width, as a vertical menu is often going to be in a sidebar, so it&#8217;s going to be restricted to a certain width, then I removed the float declaration and right margin and gave it a bottom margin instead. Amazing, flexible code powers unite&#8230; uh, sorry, got <em>too</em> excited there.</p>

<p>Why use a vertical menu? They make great sidebar menus, and secondary drop downs and long menus. Vertical menus have as many uses as his horizontal brother. Which type you choose comes down to preference and project needs based.</p>

<p>Now that you have this really solid HTML and CSS base for menus go out there and visually design some awesome menus!</p>

<p>Join me next week for a discussion about the Cascade and Importance.</p>]]></description>
				<dc:subject><![CDATA[CSS 101, Design, Development,]]></dc:subject>
				<dc:date>2010-11-02T14:30:02+00:00</dc:date>
			</item>
		
			<item>
				<title><![CDATA[Position, Absolutely.]]></title>
				<link>http://leihu.com/thought/entry/position-absolutely</link>
				<guid>http://leihu.com/thought/entry/position-absolutely</guid>
				<description><![CDATA[<p>One of the most misunderstood and seemingly complex parts of CSS is the position attribute. Position can feel out of control and difficult to manage, if you&#8217;re not clear on how and why it works the way it does. I&#8217;m here to tell you that not unlike that monster in your closet, positioning is nothing to fear.</p>

<h2>Some things to keep in mind</h2>

<p><strong>Everything is a box.</strong> Even if it doesn&#8217;t look like a box or seemingly behave like one, it is. Boxes by nature stack, sometimes they stack within one another, other times on top of each other. </p>

<p><strong>Everything has a parent.</strong> As is true with being human, one cannot exist without parents, the same is true in HTML and CSS development.</p>

<p>Now that you know those two key pieces of the puzzle&#8212;which help you not only with today&#8217;s lesson, but in general as well&#8212;we can move onto the types of positioning and their differences.</p>

<h2>The Four Horsemen of positioning</h2>

<p>There are four types of positioning. static, fixed, relative and absolute.</p>

<p><strong>static</strong> is the default type of positioning, it applies to all elements without needing to be declared, in fact if you ever find yourself needing to declare this as a positioning type, you may be writing too specific or complex code.</p>

<p><strong>relative</strong> positioning tells the browser to start the element relative to it&#8217;s original (static) location in the document.</p>

<p><strong>absolute</strong> positioning places itself on top of the rest of the document and when you set it&#8217;s top, left, bottom or right attributes it positions itself relative to the nearest positioned parent. If a positioned parent doesn&#8217;t exist it defaults to the <code><span class="syntax-element">&lt;body&gt;</span></code> of the document.</p>

<p><strong>fixed</strong> A fixed element will not scroll with the rest of the document, it&#8217;s position is independent of the browser viewport. Otherwise it behaves similarly in terms of top, left, bottom, right and z-index as an absolute positioned box does.</p>

<h2>A Few of the horsemen&#8217;s tools</h2>

<p>Position attributes are powerful on their own, but they do work well with a few other attributes that when combined give us a great deal more flexibility.</p>

<p><strong>Top, left, bottom, right.</strong> These four attributes allow us to explicitly declare where we want our positioned boxes to render in relation to the document and their positioned parents.</p>

<p><strong>z-index</strong> tells our positioned box where to be in terms on depth on the page. Yeah our HTML page has 3 dimensions, uh sort of. Only a box that has positioning of relative, absolute or fixed can be given a z-index. This allows us to layer positioned boxes on top of each other, overlapping one another if you will.</p>

<h2>Some Quick Examples</h2>

<h3>Relative</h3>

<p>Here is a common case where relative positioning can be quite useful. We have a sidebar, that contains some headings that we want to have &#8220;break out&#8221; of the left hand side of the sidebar visually. A common way that developers do this is with negative margin declaration, unfortunately negative margins don&#8217;t work in MSIE as expected.</p>

<p>The code looks like this;</p>

<div class="codeblock">
<pre><code>
<span class="syntax-id">#sidebar</span> <span class="snytax-element">h2</span>{
	<span class="syntax-attribute">left:</span> -50px;
	<span class="syntax-attribute">position:</span> relative;
	<span class="syntax-attribute">z-index:</span> 1;
}</code></pre>
</div><!-- /.codeblock -->

<p>This is saying to the browser, &#8220;Hey browser, whenever you see a <code><span class="syntax-element">&lt;h2&gt;</span></code> inside a box identified <code><span class="syntax-id">#sidebar</span></code>, go ahead and shift it to the left 50 pixels, oh yeah and please put it on top of the <code><span class="syntax-id">#sidebar</span></code>, thanks!&#8221;</p>

<h3>Absolute</h3>

<p>Here is a cool way to use absolute positioning. Let&#8217;s say in that same <code><span class="syntax-element">&lt;h2&gt;</span></code> above we want to place a neat little icon on the right side of that <code><span class="syntax-element">&lt;h2&gt;</span></code>, but not just to the right of the text, but aligned with the right hand side of the actual <code><span class="syntax-element">&lt;h2&gt;</span></code> box.</p>

<p>Here is the HTML</p>

<div class="codeblock">
<pre><code>
<span class="syntax-element">&lt;h2&gt;</span>Heading <span class="syntax-element">&lt;span <span class="syntax-class">class="cool-icon"</span>&gt;</span>Icon here<span class="syntax-element">&lt;/span&gt;&lt;/h2&gt;</span></code></pre>
</div><!-- /.codeblock -->

<p>The CSS, perhaps?</p>

<div class="codeblock">
<pre><code>
<span class="syntax-id">#sidebar</span> <span class="syntax-element">h2</span> <span class="syntax-class">.cool-icon</span>{
	<span class="syntax-attribute">background:</span> transparent url(img/cool-icon.gif) no-repeat 0 0;
	<span class="syntax-attribute">display:</span> block;
	<span class="syntax-attribute">height:</span> 16px;
	<span class="syntax-attribute">position:</span> absolute;
	<span class="syntax-attribute">right:</span> 0;
	<span class="syntax-attribute">top:</span> 0;
	<span class="syntax-attribute">width:</span> 16px;
}</code></pre>
</div><!-- /.codeblock -->

<p>The reason this works as expected is because earlier we gave the <code><span class="syntax-element">&lt;h2&gt;</span></code> a position of relative, which makes it a positioned parent. Otherwise the <code><span class="syntax-class">.cool-icon</span></code> would be in the top right hand of the browser viewport.</p>

<h3>Fixed</h3>

<p>So what about fixed positioning? What is something cool we can do easily with that? How about a <code><span class="syntax-id">#sidebar</span></code> that stays in place as the rest of the document scrolls? I&#8217;ll show you how to do that, but there is something to keep in mind, if <code><span class="syntax-id">#sidebar</span></code> ever gets taller than the browser viewport, anything below the bottom of the viewport will be inaccessible to your users, as the element is FIXED and will not scroll regardless of it&#8217;s content. You can prevent this by setting a common height on the <code><span class="syntax-id">#sidebar</span></code></p>

<p>So how to do it?</p>

<div class="codeblock">
<pre><code>
<span class="syntax-id">#sidebar</span>{
	<span class="syntax-attribute">height:</span> 550px;
	<span class="syntax-attribute">position:</span> fixed;
	<span class="syntax-attribute">z-index:</span> 1;
}</code></pre>
</div><!-- /.codeblock -->

<p>That&#8217;s that, sincerely that little guy won&#8217;t budge.</p>

<h2>Recap, and Reminders</h2>

<ol><li>Everything is a box.</li>
<li>Everything has a parent.</li>
<li>Everything starts out statically positioned.</li>
<li>Absolutely positioned elements require a positioned parent.</li>
<li>Relatively positioned elements start right where they are.</li>
<li>Fixed positioned elements stay put, and will not scroll.</li>
<li>Monsters are only scary when you don&#8217;t know their names.</li></ol>

<p>So I hope this makes you feel better about that crazy monster in your closet, and that you join me next week when I talk about menus.</p>]]></description>
				<dc:subject><![CDATA[CSS 101, Design, Development,]]></dc:subject>
				<dc:date>2010-10-25T05:59:16+00:00</dc:date>
			</item>
		
			<item>
				<title><![CDATA[Floats &amp; You]]></title>
				<link>http://leihu.com/thought/entry/floats-you</link>
				<guid>http://leihu.com/thought/entry/floats-you</guid>
				<description><![CDATA[<p>Floats, or more accurately floated elements are a popular way to handle specific layout challenges in web development and design. Unfortunately floats are also fairly misunderstood and things become much more complex than they need to be.</p>

<p>Floats are simple, in fact most CSS is simple, but that is for another article or three.</p>

<p>I would like to run down some basic examples and discuss how we get around common pitfalls, allowing us to write leaner, cleaner and more stable code.</p>

<h2>Real World Example</h2>

<p>The two column layout conundrum. Blog posts are a common use of this type of utility.</p>

<p>The HTML may often appear like this.</p>

<p><img class="center" src="/content/img/floats-nocss.gif" alt="Float Diagram, No CSS"></p>

<div class="codeblock">
<pre><code>
<span class="syntax-element">&lt;div <span class="syntax-id">id=&quot;wrap&quot;</span>&gt;</span>
	<span class="syntax-element">&lt;div <span class="syntax-id">id=&quot;header&quot;</span>&gt;</span>
		...
	<span class="syntax-element">&lt;/div&gt;</span>
	<span class="syntax-element">&lt;div <span class="syntax-id">id=&quot;main-content&quot;</span>&gt;</span>
		...
	<span class="syntax-element">&lt;/div&gt;</span>
	<span class="syntax-element">&lt;div <span class="syntax-id">id=&quot;sidebar&quot;</span>&gt;</span>
		...
	<span class="syntax-element">&lt;/div&gt;</span>
	<span class="syntax-element">&lt;div <span class="syntax-id">id=&quot;footer&quot;</span>&gt;</span>
		...
	<span class="syntax-element">&lt;/div&gt;</span>
<span class="syntax-element">&lt;/div&gt;</span></code></pre>
</div><!-- /.codeblock -->

<p>Then the related CSS would be something along these lines.</p>

<div class="codeblock">
<pre><code>
<span class="syntax-id">#wrap</span>{ 
	<span class="syntax-attribute">margin:</span> 0 auto;
	<span class="syntax-attribute">width:</span> 940px; 
}

<span class="syntax-id">#header</span>{ ... }

<span class="syntax-id">#main-content</span>{
	<span class="syntax-attribute">float:</span> left;
	<span class="syntax-attribute">width:</span> 550px;
}

<span class="syntax-id">#sidebar</span>{
	<span class="syntax-attribute">float:</span> right;
	<span class="syntax-attribute">width:</span> 200px
}

<span class="syntax-id">#footer</span>{ ... }</code></pre>
</div><!-- /.codeblock -->

<p><img class="right" src="/content/img/floats-notfixed.gif" alt="Float Diagram, Floated, Not Cleared" width="440" style="margin-right:-40px;"></p>

<p>Now this will result in the sidebar moving to the right of the wrap div, and the main-content moving to the left, allowing the two division tags to align side by side, as opposed to being stacked on top of each other as they would appear without the above CSS.</p>

<p>The header and footer divs will appear above and below the floated columns respectively, well, almost. The footer div will not go below the columns, in fact it will place it self directly below the header, however, child content (e.g. text) will be below the floated columns, but the actual body of the div is not, which can cause some unexpected results when the layout and content becomes more complex.</p>

<p>There is a way to fix this, in fact there are several ways, all of which require a little extra HTML, and some CSS, but it&#8217;s minimal and straight-forward.</p>

<p>First we add this to the HTML</p>

<div class="codeblock">
<pre><code>
<span class="syntax-element">&lt;div <span class="syntax-id">id=&quot;wrap&quot;</span>&gt;</span>
	<span class="syntax-element">&lt;div <span class="syntax-id">id=&quot;header&quot;</span>&gt;</span>
		...
	<span class="syntax-element">&lt;/div&gt;</span>
	<span class="syntax-element">&lt;div <span class="syntax-id">id=&quot;content-wrap&quot;</span> <span class="syntax-class">class=&quot;float-clear&quot;</span>&gt;</span>
		<span class="syntax-element">&lt;div <span class="syntax-id">id=&quot;main-content&quot;</span>&gt;</span>
			...
		<span class="syntax-element">&lt;/div&gt;</span>
		<span class="syntax-element">&lt;div <span class="syntax-id">id=&quot;sidebar&quot;</span>&gt;</span>
			...
		<span class="syntax-element">&lt;/div&gt;</span>
	<span class="syntax-element">&lt;/div&gt;</span>
	<span class="syntax-element">&lt;div <span class="syntax-id">id=&quot;footer&quot;</span>&gt;</span>
		...
	<span class="syntax-element">&lt;/div&gt;</span>
<span class="syntax-element">&lt;/div&gt;</span></code></pre>
</div><!-- /.codeblock -->

<p>I&#8217;ve added a new div, wrapped around the <code><span class="syntax-id">#main-content</span></code> and <code><span class="syntax-id">#sidebar</span></code> divs, this gives us a few options, and in reality, this extra div, is almost never extraneous given the complexity of design these days.</p>

<p>We also need to add this small rule to the CSS.</p>

<div class="codeblock">
<pre><code>
<span class="syntax-class">.float-clear</span><span class="syntax-psuedo">:after</span>{
	<span class="syntax-attribute">content:</span> ".";
	<span class="syntax-attribute">clear:</span> both;
	<span class="syntax-attribute">display:</span> block;
	<span class="syntax-attribute">height:</span> 0;
	<span class="syntax-attribute">font-size:</span> 0;
	<span class="syntax-attribute">visibility:</span> hidden;
}</code></pre>
</div><!-- /.codeblock -->

<p><img class="right" src="/content/img/floats-fixed.gif" alt="Float Diagram, Floated, Cleared" width="440" style="margin-bottom:15px;margin-right:-40px;"></p>

<p>The way this works is it places a period (.) character directly following the last child in the parent, so in our example it places a period right after the <code><span class="syntax-id">#sidebar</span></code> inside the <code><span class="syntax-id">#content-wrap</span></code>. Next it applies <code><span class="syntax-attribute">clear:</span> both</code> to that period, which forces anything below it to actually flow below it. The <code><span class="syntax-attribute">display:</span> block</code>, forces the period to be a block level element, which makes it fill the entire parent width wise. The rest is used to visually hide the period, so that it does not disrupt our layout aside from the way we intend it to.</p>

<p>And the best part? MSIE doesn&#8217;t require this code at all, in fact MSIE has a rendering difference which causes it to auto clear floats by default, what a neat little trait. However, MSIE will need you to to assign the following line of code to your iepatch file </p>

<div class="codeblock">
<pre><code>
<span class="syntax-class">.float-clear</span>{ <span class="syntax-attribute">height:</span> 1%; }</code></pre>
</div><!-- /.codeblock -->

<p>This gives the element has-layout, which is important for MSIE, another neat quirk.</p>

<p>That is pretty great right? Yes, I agree.</p>

<p>Well if I&#8217;m being fair, there is another completely acceptable way to clear the floats.</p>

<h3>alternate a</h3>

<div class="codeblock">
<pre><code>
<span class="syntax-id">#content-wrap</span>{ <span class="syntax-attribute">overflow:</span> hidden; }</code></pre>
</div><!-- /.codeblock -->

<p>Now while this does <em>work</em>, it does have some caveats and in my opinion makes for much more complex CSS down the road, and dependent on the complexity of your design, that can become a huge unnecessary headache. For instance, if <code><span class="syntax-id">#content-wrap</span></code> needs to have a height applied, if <code><span class="syntax-id">#main-content</span></code> or <code><span class="syntax-id">#sidebar</span></code> ever get any taller than that set height, their content will be hidden at the point where their height meets the set height of the <code><span class="syntax-id">#content-wrap</span></code> div.</p>

<p>So I hear you asking, why bother with confusing us with this alternate solution, when the first solution works well and as intended/expected? Well, I find the best way to guide a person to the right solution is to show them why the alternates aren&#8217;t as good.</p>

<p>OK. That my friends is floats in a nutshell. I hope they are a bit less confusing now. Join me next week for Positioning, Absolutely!</p>]]></description>
				<dc:subject><![CDATA[CSS 101, Design, Development,]]></dc:subject>
				<dc:date>2010-10-11T07:00:30+00:00</dc:date>
			</item>
		
    
	</channel>
</rss>
