<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Dan Ott</title>
    <link>http://virb.com/danieltott</link>
    <description><![CDATA[]]></description>
    <generator>Virb 2.0 (@danieltott)</generator>
    <language>en</language>
    <item>
      <title>Clear Your Floats Even Easier</title>
      <link>http://virb.com/danieltott/posts/text/1018182</link>
      <description><![CDATA[<p>One of the more popular posts on this site is <a href="http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/" title="Clear your floats: the right way">my explanation of the easyclear method</a> of clearing floats. I had been using it for a while when I wrote the post, and it's a great solution. However, <a href="http://www.dave-woods.co.uk/" title="Dave Woods">Dave Woods</a> <a href="http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-86" title="Dave Woods' comment">commented</a> on that post with a new method: setting overflow:auto on the containing element actually has the same effect as the clearfix, without all the extra&nbsp;stuff. </p>
<p>I thought, "that <em>can't</em> be right...can it?" Turns out Dave was right. After looking into it some more, it turns out that overflow:auto and overflow:hidden both work the same way, and that's&nbsp;it. </p>
<pre class="code_example">
	.containingElement{ overflow: hidden; }
</pre>
<p>Of course, IE6 doesn't play along with the rest, so as always, here's the&nbsp;hack:</p>
<pre class="code_example">
	* html #container{ height: 1%; }
</pre>
<p>Use this hack (or one without the * html inside an ie6-only stylesheet) to make ie6 behave&nbsp;correctly.</p>
<h3>That's all there is to&nbsp;it.</h3>
<p>I have since began using it everywhere, and it works flawlessly. The only time it doesn't work correctly is when you actually need elements to overflow the box (a drop-down menu for example, or any absolutely positioned elements outside of the box). In these cases, I fall back on the trusty clearfix. But for all others, overflow:hidden to the&nbsp;rescue!</p>
<img src="http://feeds.feedburner.com/~r/dtott/~4/504891900" height="1" width="1" />]]></description>
      <pubDate>Wed, 07 Jan 2009 03:17:58 -0800</pubDate>
      <guid>http://virb.com/danieltott/posts/text/1018182</guid>
    </item>
    <item>
      <title>Tools That Help Me Work</title>
      <link>http://virb.com/danieltott/posts/text/898186</link>
      <description><![CDATA[<p>I have a lot of articles "in the pipes," but I've been finding it hard to get into the rhythm of writing again, so I thought I'd start with an easy post to get the juices flowing.  This sort of post is obviously something plenty of people have done before, but I usually find them interesting. Since it's been done before, I thought I would concentrate on some of the smaller things that make my life better/easier, instead of the normal operating system (OS X Leopard)/text editor (Coda)&nbsp;writeup.</p>
<h3>Versions</h3>
<p><a href="http://www.versionsapp.com/" title="Versions' Website">Versions</a> is a Mac SVN client that works very, very well. I had been using <a href="http://www.lachoseinteractive.net/en/community/subversion/svnx/features/" title="svnX Subversion Client">svnX</a>, which never really gave me any problems, but after using Versions for about a day, you wouldn't really be able to convince me to go back. Versions has the polish that Mac users have come to expect, both visually, and interaction-wise. I'm able to group all of my repositories in different folders, and working copies show up under their respective repository. All in all, a very nice app that I take for granted now because it works so&nbsp;well.</p>
<h3>TextExpander</h3>
<p>Most text editors these days have the idea of "clips," or something similar, in which you build a library of code snippets, and them access them in different ways. What <a href="http://www.smileonmymac.com/TextExpander/" title="TextExpander by SmileonmyMac">TextExpander</a> does is take that functionality and build it into the operating system, so that you can just type a certain code word, and it automatically replaces it with the given&nbsp;text.</p>
<p>This is not only useful for work (I type "rreset" to have it spit out Meyer's CSS reset), but also for normal, everyday typing. I have my address saved, so that if I type the numbers from my address, it replaces it with the whole thing. Same with city ("bll" becomes "Bloomington"), email, lots of things. I use it without thinking, and every time I type the same thing more than a few times, it goes into textExpander. It keeps track of the time it saves you, and I'm over two hours now. Two hours is a lot of&nbsp;typing.</p>
<h3>Billings</h3>
<p>Any freelancer needs to have a setup that they're completely comfortable with for tracking time, creating/sending invoices, and tracking clients/payments/etc. There are tons of great tools out there, and I've used a number of them. Up until about a month ago, I had been using <a href="http://www.officetime.net/" title="OfficeTime">OfficeTime</a> for time tracking and invoice creating, and a plain spreadsheet for tracking client&nbsp;payments.</p>
<p>A month or two ago, I found <a href="http://www.billingsapp.com/index.html" title="Billings 3">Billings 3</a>, and tried it out. Like Versions, Billings is a much nicer app to work with than OfficeTime, which attracted me from the beginning. However, Billings is a much more comprehensive tool for organizing your business than officeTime is. I need to try hard to be organized, so anything that helps me do that is a plus. Billings makes staying on top of the business end of things much easier on me. I can track estimates, time, clients, payments, personal projects, and a lot of other things, all in one&nbsp;place. </p>
<p>Billing's invoice/estimate templating engine is also very extensive. I've been finding it a little difficult to get into it to build custom templates from scratch, but changing small things on one of their many built-in templates is pretty straight forward, and creates nice-looking results. They also export into pdfs, instead of rtfd's (which is what OfficeTime used). All in all a great tool that has already helped me be more comfortable keeping track of&nbsp;things.</p>
<h3>Evernote</h3>
<p>Put <a href="http://evernote.com/" title="Evernote">Evernote</a> into the "tools that help dan stay organized" pile. Their slogan is "Remember everything," which is nice for me, because my unofficial slogan is "I forget everything." I use Evernote constantly. I keep article ideas, work notes, javascript tricks i'd like to try sometime, and lots of other stuff in there. It searches instantly, and can capture all sorts of stuff. I've been using it for a couple months now, and have over a 100 notes stored, mostly work-related. Also, like most of the other apps on this list, it has that nice Mac "feel" to&nbsp;it.</p>
<p>Evernote is also useful because it has an iPhone companion app that syncs with your desktop account, so I can take a quick note when I'm away from my computer, and then file it when I get&nbsp;home.</p>
<h3>Firebug</h3>
<p>If I had to get rid of every app that I use in my business but one, I would keep <a href="http://getfirebug.com/">Firebug</a>. I can't even begin to estimate how much time Firebug has saved me while developing websites, and there really isn't anything that compares. I could write a whole article on it, but I'm just going to leave it at this: if you build websites, you should be using&nbsp;firebug.</p>
<img src="http://feeds.feedburner.com/~r/dtott/~4/433874708" height="1" width="1" />]]></description>
      <pubDate>Tue, 28 Oct 2008 22:16:30 -0700</pubDate>
      <guid>http://virb.com/danieltott/posts/text/898186</guid>
    </item>
    <item>
      <title>I'm Back (I Promise)</title>
      <link>http://virb.com/danieltott/posts/text/825992</link>
      <description><![CDATA[<p>It's been a very busy summer. Between <a href="http://flickr.com/photos/dtott/sets/72157605640047678/" title="My house pictures on flickr">buying a house</a>, moving into said house, <a href="http://flickr.com/photos/ehiddy/sets/72157606817768795/" title="Wedding pictures on Emily's flickr page">getting married</a>, <a href="http://flickr.com/photos/ehiddy/sets/72157606770646008/" title="Our vacation photos on Emily's flickr page">vacationing</a>, and somehow managing to work, I haven't had any time for the website. But I'm finally caught up with (most) everything, so I thought it was time to get back to the&nbsp;blog.</p>
<p>Everything this summer went really well. Emily and I are both happy with the house, and being married ain't half bad. It is good to get back to everything,&nbsp;though. </p>
<p>While this post might not be of very much use to you, I thought I'd drop a line, and let you know I've got some articles coming down the pipeline for you, plus I'll be joining a <a href="http://shallowthoughts.org/" title="Bridget Stewart">handful</a> <a href="http://resistmedia.net/blog/" title="Beth Dean (hopefully)">of</a> <a href="http://www.colbowdesign.com/" title="Brad Colbow">good</a> <a href="http://braddielman.com/" title="Brad Dielman">people</a> at <a href="http://www.aneventapart.com/events/2008/chicago/">AEA Chicago</a>, and I'm sure I'll have some something to say about that, as well. So stay tuned, and I'll see you&nbsp;soon.</p>
<img src="http://feeds.feedburner.com/~r/dtott/~4/393665887" height="1" width="1" />]]></description>
      <pubDate>Mon, 15 Sep 2008 22:03:15 -0700</pubDate>
      <guid>http://virb.com/danieltott/posts/text/825992</guid>
    </item>
    <item>
      <title>Naked Is As Naked Does</title>
      <link>http://virb.com/danieltott/posts/text/558646</link>
      <description><![CDATA[<p>Today, April 9th, is <a href="http://naked.dustindiaz.com/" title="Naked Day">Naked Day</a>. It's an annual event in which sites remove all of their style information, to reveal the naked page structure underneath. This is my first year participating, but I think it's a great&nbsp;idea.  </p>
<p>Naked Day promotes the importance of valid, semantic html and a solid page structure in your designs. The bottom line is this: your site should still look good, even if it's&nbsp;naked.</p>
<img src="http://feeds.feedburner.com/~r/dtott/~4/266985198" height="1" width="1" />]]></description>
      <pubDate>Wed, 09 Apr 2008 17:36:35 -0700</pubDate>
      <guid>http://virb.com/danieltott/posts/text/558646</guid>
    </item>
    <item>
      <title>CSS Off Is Back!</title>
      <link>http://virb.com/danieltott/posts/text/530240</link>
      <description><![CDATA[<p>I'm very excited to announce that <a href="http://cssoff.com/2008/03/20/next-contest-is-april-4-2008/">CSS Off is back</a> from a brief hiatus. Clevelander <a href="braddielman.com" title="Brad Dielman">Brad Dielman</a> has come on board to lend his expertise to the project, and Clevelander (and Brad) <a href="http://bradcolbow.com" title="Brad Colbow">Brad Colbow</a> is our guest designer.  I've seen the comp already, and it's going to be a&nbsp;challenge.  </p>
<p>The contest will be on April 5, 2008, and will follow the same 24-hour format that it always has.  So get out your coding hats and practice your <a href="http://microformats.org/" title="microformats.org">microformats</a>; CSS Off is&nbsp;back!</p>
<img src="http://feeds.feedburner.com/~r/dtott/~4/257052422" height="1" width="1" />]]></description>
      <pubDate>Mon, 24 Mar 2008 19:11:33 -0700</pubDate>
      <guid>http://virb.com/danieltott/posts/text/530240</guid>
    </item>
    <item>
      <title>Auto-Cropping Rounded Corners</title>
      <link>http://virb.com/danieltott/posts/text/518622</link>
      <description><![CDATA[<p>I know, I know.  What this world really needs is a new rounded corners solution.  With CSS3 support right around the corner (ha, right), why bother,&nbsp;right?</p>
<p>Well, this solution offers something new to the world of rounded corners.  What it does is this: it crops the content below it, so that anything with a background color or image (headers, paragraphs, even images) automatically get the rounded corner treatment with no extra work.  See&nbsp;below:</p>
<p><img src="http://dtott.com/examples/croppingcorners/images/screenshot.jpg" alt="Screenshot of cropping corners" style="width:49em;" /></p>
<p>In this screenshot, the image is a normal, rectangular image.   Nothing was done to it, except inserting it inside one of my rounded corners containers.  It's easy enough that you can even have your clients do it in their CMSs without the headache of trying to teach them to use the Rounded Rectangle Tool in&nbsp;Photoshop.</p>
<p>This technique solves a very specific issue.  There are plenty of ways to render rounded corners that involve less markup, simpler CSS, and less time in photoshop, but none of them (that I am aware of) crop the content below&nbsp;it.</p>
<p>You can view the solution at work <a href="http://dtott.com/examples/croppingcorners/index.html" title="Cropping Corners Example">here</a>, and I'll try to take you through how it&nbsp;works.</p>
<h3>First, The&nbsp;Images</h3>
<p>So this part isn't too hard, as long as you can navigate your way around photoshop.  Just as a note, it's definitely possible that there are better ways to go about this part in photoshop.  If there are, don't hesitate to drop a line in the&nbsp;comments.</p>
<p>First things first: go and download the <a href="http://www.fnordware.com/superpng/" title="Super PNG">Super PNG</a> plug-in for photoshop.  What this plug-in does is strips out the color information that photoshop usually saves with PNGs, which will help you avoid that little difference you can see between browsers.  See <a href="http://hsivonen.iki.fi/png-gamma/" title="The Sad Story of PNG Gamma Correction">here</a> for a more detailed explanation, but this is&nbsp;important. </p>
<p> Once you've got Super PNG running, use the aforementioned Rounded Rectangle Tool to create a rounded rectangle with your desired radius and give it the background color of your container.  Edit the layer style to give it a stroke of whatever width you'd like, then rastersize it.  Then, decide how much padding you want to be cropped inside your container (I used 2 pixels in the screenshot above).  Duplicate your rectangle, and shrink it to fit inside of your desired padding.  CMD/CTRL+click on the layer thumbnail to load the selection on the smaller rectangle, then select the larger rectangle and hit delete.  You can now throw out the smaller&nbsp;rectangle.</p>
<p>Once this is done, you should have the outline of a container.  Now, zoom in to one of the corners, and, using the marque tool, select a square that is just big enough to contain the corner.  Copy it, open a new document, and paste it in.  Throw out the background, if there is one, and you should have a corner that looks something like&nbsp;this:</p>
<p><img src="http://dtott.com/examples/croppingcorners/images/borderscreenshot.jpg" title="The top-left border at %1200" /></p>
<p>Once you've got this, simply save it, then rotate it and save it three more times so that you end up with each&nbsp;corner.</p>
<h3>Second, The&nbsp;HTML</h3>
<p>Now that that annoying photoshop work is done, I'm going to start referring you to an actual example, located here.  Here's the HTML for one&nbsp;box: </p>
<pre name="code" class="HTML">
&lt;div class="b_greyWhiteStroke"&gt;
	&lt;div class="TL"&gt;&lt;/div&gt;
	&lt;div class="BL"&gt;&lt;/div&gt;
	&lt;div class="TR"&gt;&lt;/div&gt;
	&lt;div class="BR"&gt;&lt;/div&gt;
	&lt;div class="b_innerContainer"&gt;
		&lt;h2&gt;This Is A Block&lt;/h2&gt;
		&lt;p&gt; Lorem ipsum dolor sit amet...&lt;/p&gt;
	&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>This is fairly simple.  There's a div for the outer container, a div for the inner container, and a div for each border. All of your content will go inside .b_innerContainer, and the corners of this content will automatically be&nbsp;cropped.</p>
<h3>Third, The&nbsp;CSS</h3>
<p>The CSS for this solution is a little more complicated, but nothing too bad.  The basic idea is that you give the border divs position:absolute, place them in the corners, and let them sit on top of everything else, thus cropping&nbsp;it:</p>
<pre name="code" class="css">
.b_greyWhiteStroke{
	position: relative;
	border-color: #dce3e7;
}

.TL, .BL, .TR, .BR{
	width: 6px;
	height: 6px;
	position: absolute;
	background-repeat: no-repeat;
	background-color: transparent;
	z-index: 9999 !important;
}

.TL{
	top:0;
	left:0;
}
.BL{
	bottom: 0;
	left: 0;
}
.TR{
	top:0;
	right:0;
}
.BR{
	bottom: 0;
	right: 0;
}

.b_greyWhiteStroke .TL{
	background-image: url(images/grey_whitestroke_tl.png);
}
.b_greyWhiteStroke .BL{
	background-image: url(images/grey_whitestroke_bl.png);
}
.b_greyWhiteStroke .TR{
	background-image: url(images/grey_whitestroke_tr.png);
}
.b_greyWhiteStroke .BR{
	background-image: url(images/grey_whitestroke_br.png);
}

.b_innerContainer{
	border-width: 1px;
	border-style: solid;
	padding: 2px 2px 8px;
}

.b_greyWhiteStroke .b_innerContainer{
	border-color: #dce3e7;
}
</pre>
<p>See, that's not too bad, is it?  A couple notes here.  First, I've separated .TR from .b_greyWhiteStroke .TR.  This is so that I can have multiple background-color schemes going with only minor additions to the CSS.  So, if i wanted to create, say, and alert box with a yellow border, I wouldn't have to rewrite all the existing CSS, I'd just have to make some&nbsp;additions.</p>
<h3>What about&nbsp;ie6?</h3>
<p>Ie6, as always, was the big headache here.  However, by hacking up <a href="http://www.twinhelix.com">Angus Turnbull</a>'s <a href="http://www.twinhelix.com/css/iepngfix/">IE PNG Fix</a> with a couple of my own modifications, I managed to get it to work.  The problem, aside from ie6's refusal to run transparent PNGs, was that the border block wouldn't always line up with the edge of the container.  I assume it's some sort of rounding error, but I'm not positive about that.  Anyway, the PNG Fix now fixes the transparency, and checks to make sure the borders are where they should be. The only problem here is that this solution doesn't work in ie6 when you use a fluid width.  Or, more correctly, it will correct itself when the page loads, but there is a possibility of the borders moving a pixel out of place if user starts manually changing the width of the window. Check out <a href="http://dtott.com/examples/croppingcorners/index.html" title="Cropping Corners Example">the example page</a> in ie6 to see what i mean.  Here is the code to include this&nbsp;fix:</p>
<pre name="code" class="html">
&lt;!--[if lte IE 6]&gt;
&lt;style type="text/css"&gt;
	.TL, .BL, .TR, .BR{ overflow: hidden; behavior: url("ie6fixborders.htc"); }
&lt;/style&gt;
&lt;![endif]--&gt;
</pre>
<h3>The&nbsp;End</h3>
<p>So, there you have it.  You can download the entire example <a href="/examples/croppingcorners/croppingCorners.zip" title="Cropping Corners .zip file">here</a>.  This solution, for sure, is not the best for all situations.  There are tons of smaller and easier solutions out there, and you should use them unless you have this specific need.  However, if you do decide you need something like this, I think you'll find it to your&nbsp;liking. </p>
<p>As always, I'm more than open for comments and suggestions for improvement.  Hopefully you'll find this solution useful sometime in the&nbsp;future. </p>
<img src="http://feeds.feedburner.com/~r/dtott/~4/252795666" height="1" width="1" />]]></description>
      <pubDate>Mon, 17 Mar 2008 16:31:34 -0700</pubDate>
      <guid>http://virb.com/danieltott/posts/text/518622</guid>
    </item>
    <item>
      <title>Convert Pixels To Ems - A Bookmarklet</title>
      <link>http://virb.com/danieltott/posts/text/425098</link>
      <description><![CDATA[<p>Recently, I was writing a Javascript app that involved some animated, expanding boxes.  While doing this, I realized I needed a way to dynamically convert pixels to computed ems. The function wasn't too complicated, and so I decided to make a bookmarklet out of it that did the same thing.  It was kind of fun.  Hopefully you'll find it useful, either in javascript, or to remove the headache when you're trying to create pixel-perfect designs using&nbsp;ems</p>
<h3>The&nbsp;Function</h3>
<p>So, here are the&nbsp;functions:</p>
<pre name="code" class="javascript">
//this function returns the computed pixel value
//of 1em relative to the given element
function getComputedEm(el){
	var tdiv = document.createElement("div");
	tdiv.style.height = "1em";
	tdiv.style.position = "absolute";
	tdiv.style.backgroundColor = "#f00";
	el.appendChild(tdiv);
	var emValue = tdiv.offsetHeight;
	el.removeChild(tdiv);
	return emValue;
}
//this function takes an integer, and a javascript element.
function convertPixelsToEms(pixels, el){
	var emval = getComputedEm(el);
	var value = pixels/emval;
	return Math.round(value*100)/100;
}
</pre>
<h3>The&nbsp;Bookmarklet</h3>
<p>And here's the&nbsp;bookmarklet:</p>
<p style="text-align:center;"><a>pixel2em</a></p>
<p>Just drag the link above to your menu bar, and click on it in any site.  The bookmarklet will appear at the top of the page.  It takes a pixel amount, and any css selector you can think of, so it will return the conversion relative to an element.  For example, on this site, if you use "body", 16 pixels = 1.14em, but if you use #content p, 16 pixels =&nbsp;1.23em.</p>
<p>It's probably not perfect, so please let me know if things aren't working correctly.  Although, I can tell you right now it's not going to work on ie6, so don't bother trying it&nbsp;there.</p>
<p>The bookmarklet makes use of Dean Edward's <a href="http://dean.edwards.name/my/cssQuery/" title="cssQuery">cssQuery</a>, a slick little script to retrieve elements based on CSS&nbsp;selectors.</p>
<p>All in all, this was a fun experiment, and I hope you find it useful.  Have&nbsp;fun.</p>
<img src="http://feeds.feedburner.com/~r/dtott/~4/219525133" height="1" width="1" />]]></description>
      <pubDate>Sun, 20 Jan 2008 17:22:04 -0800</pubDate>
      <guid>http://virb.com/danieltott/posts/text/425098</guid>
    </item>
    <item>
      <title>Twitter This</title>
      <link>http://virb.com/danieltott/posts/text/371125</link>
      <description><![CDATA[<p>So most everyone I know in the community is a <a href="http://twitter.com" title="Twitter">Twitter</a> user, but I've managed to avoid it up to this point.  However, seeing as I have absolutely nothing to do today, <a href="https://twitter.com/danieltott" title="My Twitter Page">I joined Twitter</a>.  I'm hoping it will give me a chance to say things that are too inconsequential for a full-on blog post, but that I still want people to hear.  Up till now, I was using <a href="http://sprokets.net" title="Sprokets">Sprokets</a>' <a href="http://www.campfirenow.com/" title="37 Signal's Campfire">campfire</a> room for that purpose.  I'll probably keep doing that, but, you know, Twitter is cool,&nbsp;too.</p>
<p>That being said, I'm a total n00b when it comes to Twitter.   I'm aware of <a href="http://snook.ca/snitter/" title="Snitter">Snitter</a> and <a href="http://iconfactory.com/software/twitterrific" title="Twitterrific">Twitterrific</a>, but are there other Twitter clients out there?  Which one do you use/which one is best?  Also, are there any people out there that I really should add to my "follow"&nbsp;list?  </p>
<p>How about terminology?  Have I already embarrassed myself by not using the in-lingo when referring to different parts of Twitter?  <a href="http://braddielman.com" title="Brad Dielman">Brad</a> just "nudged" me; I'm not even sure what that means.  Is that like first&nbsp;base?  </p>
<p>Well, either way, I'm looking forward to trying it out.  We'll see what&nbsp;happens.</p>
<img src="http://feeds.feedburner.com/~r/dtott/~4/200456296" height="1" width="1" />]]></description>
      <pubDate>Fri, 14 Dec 2007 15:56:57 -0800</pubDate>
      <guid>http://virb.com/danieltott/posts/text/371125</guid>
    </item>
    <item>
      <title>Clear Your Floats - The Right Way</title>
      <link>http://virb.com/danieltott/posts/text/365385</link>
      <description><![CDATA[<h3><strong>UPDATE</strong></h3>
<p>Read <a href="http://dtott.com/thoughts/2009/01/06/clear-your-floats-even-easier/">http://dtott.com/thoughts/2009/01/06/clear-your-floats-even-easier/</a> for an even easier way of dealing with floating&nbsp;elements.</p>
<p>Then come back and read&nbsp;this.</p>
<p>Aside from browser bugs, float clearing can be one of the most frustrating aspects of CSS development.  It takes a little bit of patience and thought to set up your floats and clears in a way that facilitates both your design and the flexibility required in a modern&nbsp;website.  </p>
<h3>The Old&nbsp;Way</h3>
<p>While judging the last contest of <a href="http://cssoff.com/" title="CSS Off">CSS Off</a>, one of the things that I found myself repeating over and over again was this: "Don't use empty divs to clear your floats!"  What I meant by that was that in this day and age, there exist much better, more robust, and more semantically correct ways to properly clear floats that simply inserting &lt;div&nbsp;class="clear"&gt;&lt;/div&gt;.</p>
<h3>The Not Really New&nbsp;Way</h3>
<p>Enter the <a href="http://www.positioniseverything.net/easyclearing.html" title="Easy Clear on positioniseverything.net">EasyClear method</a>.  I'm calling this the "Not Really New Way" because it appeared on <a href="http://positioniseverything.net" title="positioniseverything.net">positioniseverything.net</a> in 2004, but is still being ignored for the old empty clear div&nbsp;solution. </p>
<p>I'm not going to spend time explaining the specifics of <em>why</em> this solution works; they have gone over the technical aspects of the solution in the article, especially different hacks for different browsers.  However, before I explain the best way to <em>use</em> the EasyClear on your sites, there is one part of CSS that needs to be understood, since the entire EasyClear method hinges on it: the :after&nbsp;pseudo-element. </p>
<h3>:after - Intrigue and&nbsp;Deception</h3>
<p>For a long time, I was confused about the :after pseudo-element.  After doing a little testing and research, I figured it out.  It's not all that difficult to understand, actually, but I was mislead in the beginning.  The <a href="http://www.w3schools.com/css/pr_pseudo_after.asp" title=":after on w3schools.com">w3schools.com's definition</a> of :after is  the first that pops on on a quick <a href="http://www.google.com/search?q=css+%3Aafter" title="Google: CSS :after">Google search</a>, so it was the first place I&nbsp;went:</p>
<blockquote><p>The :after pseudo-element inserts some content after an&nbsp;element.</p>
</blockquote>
<p>It turns out that this is <em>completely</em> incorrect.  The <a href="http://www.w3.org/TR/REC-CSS2/selector.html#before-and-after" title=":after on w3.org">actual definition</a> (via <a href="http://www.w3.org" title="W3">The W3</a>) is this (emphasis&nbsp;added):</p>
<blockquote><p>The ':before' and ':after' pseudo-elements can be used to insert generated content before or <strong><em>after an element's&nbsp;content</em></strong>.</p>
</blockquote>
<p>The difference between the two definitions is considerable.  Content inserted using the :after pseudo-element is inserted not after the element, but instead <em>within</em> the element and <em>after</em> the content. See an example&nbsp;<a href="http://dtott.com/examples/easyclear/after_example1.html" title=":after example">here</a>. </p>
<p>You can use :after to insert just about any content you'd like, and give it most CSS attributes, including display and clear.  This is how EasyClear works its&nbsp;magic.</p>
<h3>Using&nbsp;EasyClear</h3>
<p>Using EasyClear is simple.  The only trick is to apply it to the correct element.  The element that you are going to apply it to most is the element <em>containing</em> the floated elements.  For example, a page with a container that has a background you'd like to extend to include the entire content, and two floated&nbsp;elements:</p>
<p><img src="http://dtott.com/examples/easyclear/example_page.png" alt="Example page" title="Example page" /></p>
<p>In this example, you want to apply the EasyClear to #container, since that is the containing element.  It will insert a block-level element with the clear attribute set to both, thus clearing the floats inside the element without crufting up your HTML. You can see an example at work <a href="http://dtott.com/examples/easyclear/easyclear_example.html" title="EasyClear example">here</a>, and here's the EasyClear CSS&nbsp;itself:</p>
<pre class="code_example">
/* EasyClearing http://www.positioniseverything.net/easyclearing.html */
#container:after
{
	content: ".";
	display: block;
	height: 0;
	clear: both;
	visibility: hidden;
}

#container
{display: inline-block;}

/* Hides from IE-mac \*/
* html #container
{height: 1%;}

#container
{display: block;}
/* End hide from IE-mac */

</pre>
<p>As you can see, it's pretty simple to employ, and the results are perfect.  The best way that I've found to implement this on larger projects is to keep the EasyClear in one place, at the bottom of your main stylesheet, and simply add elements that you need to clear to the declaration itself, as illustrated&nbsp;<a href="http://dtott.com/examples/easyclear/easyclear_example2.html" title="EasyClear multiple-element example">here</a>.</p>
<h3>Clears For&nbsp;All</h3>
<p>So now you never have to insert an empty div into your otherwise perfectly crafted HTML.  Go read <a href="http://www.positioniseverything.net/easyclearing.html" title="Easy Clear on positioniseverything.net">the article</a>, learn the background, spread the word, and, please, just start using&nbsp;it!</p>
<img src="http://feeds.feedburner.com/~r/dtott/~4/198393959" height="1" width="1" />]]></description>
      <pubDate>Tue, 11 Dec 2007 04:59:44 -0800</pubDate>
      <guid>http://virb.com/danieltott/posts/text/365385</guid>
    </item>
    <item>
      <title>Format Your CSS</title>
      <link>http://virb.com/danieltott/posts/text/353277</link>
      <description><![CDATA[<p>For years, I've always formatted my CSS in what I like to think of as the "traditional" manner.  Each selector on one line, and each property indented one tab&nbsp;underneath:</p>
<pre class="code_example">
#content{
	width:49em;
	padding: 0 1.5em;
	margin: 0 auto;
	clear: both;
}
#content h2{
	font-size: 2em;
	height: 1.5em;
	margin-left: .75em;
	color: #000;
}
#content h2 a{
	font-weight: normal;
	float: left;
}
#content h3{
	font-size: 1.25em;
	line-height: 1.2em;
	color:#4d9fdd;
}
</pre>
<p>Pretty standard stuff.  I'd break up sections with big comments, and that made it fairly easy to scan.  While this format never caused and problems <em>per se</em>, and it was easy enough to implement, it never seemed completely&nbsp;ideal. </p>
<p>When I started working with <a href="http://sprokets.net" title="Sprokets">Sprokets</a>, the other front-end developer there was using one-line css declarations.  This threw me for a loop for a while, but I slowly started liking it better and&nbsp;better.</p>
<p>The method I've finally settled on is based on the one-line approach, but with an extra twist: I indent the declarations based on it's place in the HTML document.  For example, take the HTML for this simple&nbsp;page:</p>
<pre class="code_example">&lt;body&gt;
	&lt;div id="one"&gt;
		&lt;p&gt;text&lt;/p&gt;
		&lt;p&gt;text&lt;/p&gt;
	&lt;/div&gt;
	&lt;div id="two"&gt;
		&lt;p&gt;text&lt;/p&gt;
		&lt;ul&gt;
			&lt;li&gt;list item&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/div&gt;
&lt;/body&gt;</pre>
<p>The CSS to access this code would be like&nbsp;this:</p>
<pre class="code_example">
body{ properties; }

	#one{ properties; }
		#one p{ properties; }

	#two{ properties; }
		#two p{ properties; }

		#two ul{ properties; }
			#two ul li{ properties; } </pre>
<p>This has worked very well for me so far, and I'm looking forward to trying out on some bigger projects. It allows me to scan through my CSS much more quickly, view comments more easily, and has the added benefit of helping me think through things like descendants and inheritance.  Take a look at <a href="/thoughts/wp-content/themes/dtott/style.css" title="dtott.com stylesheet">the CSS for this site</a> to see it in action on a bigger&nbsp;scale.</p>
<p> This method, while new for me, is clearly <a href="http://www.dustindiaz.com/css-indention-method/" title="i.e. someone else did it a while ago">not revolutionary</a>. However, since I stumbled on it on my own, I thought some of you guys might benefit from it as I have. How do you format your&nbsp;CSS?</p>
<img src="http://feeds.feedburner.com/~r/dtott/~4/194487692" height="1" width="1" />]]></description>
      <pubDate>Mon, 03 Dec 2007 13:29:51 -0800</pubDate>
      <guid>http://virb.com/danieltott/posts/text/353277</guid>
    </item>
    <item>
      <title>It's been a while.</title>
      <link>http://virb.com/danieltott/posts/text/349870</link>
      <description><![CDATA[<p>Well, well.  It looks like someone has been neglecting their&nbsp;blog.  </p>
<p>It happens, I guess.  The problem I ran in to as time wore on without a post was that the longer I went, the more epic the post had to be that finally got me started again.  A lot of things have happened, and I wanted to talk about <em>all</em> of them.  Obviously, the post that I had in mind kept getting longer and&nbsp;longer.</p>
<p>Well, no more.  Partly inspired by <a href="http://russcasenhiser.typepad.com/" title="Russ Casenhiser">Russ Casenhiser</a> (via <a href="http://unstoppablerobotninja.com/" title="Unstoppable Robot Ninja">URN</a>), and partly because I just needed to get going again, I present you with this post: a (mostly incomplete) roundup of most of the things I've wanted to touch on.  Some of it may be old news, some of it may be new.  Either way, after this post I can get back on the blogging horse&nbsp;again.   </p>
<h3>iPhoneification</h3>
<p>I got an iPhone in late September.  I love it.  It's one of those purchases where, after a couple weeks, I forgot how I lived without it.  I was apprehensive about the keyboard, but it turns out that was <em>completely</em> unfounded.  I don't even have to really try to type correctly, because the iPhone's auto-correct is so amazing.  The EDGE network isn't as slow as everyone says (it's slow, but come on, people, it's not that bad).  The integration between Safari, Google Maps, and the actual phone features is so convenient, it's ridiculous.  I haven't regretted buying one for an&nbsp;instant.</p>
<h3><span class="dquo">"</span>It's Sproket, not&nbsp;socket!"</h3>
<p>I joined the <a href="http://sprokets.net/" title="Sprokets">Sprokets</a> team sometime a few months ago.  This experience has been a revelation for me.  I'd never worked with more than one other person on a project before, so coming on board with a team like Sprokets was, while a little intimidating at first, ultimately a huge breath of fresh air.  It's allowed me to concentrate on honing my front-end skills, and collaborating with other skilled developers always helps me improve across the board. It also lead me to a new way for me to format my CSS, so watch for a post on that in the&nbsp;future.</p>
<h3>Leopardosity</h3>
<p>I pre-ordered <a href="http://www.apple.com/macosx/" title="OS X 10.5">Leopard</a>, and installed it as soon as I got it.  Again, a new Apple product that I love. Leopard gave me Time Machine, Screen Sharing, a new sidebar in Finder, major improvements in Spotlight, and Spaces.<br />
Spaces could use some improvement, especially when you mix Spaces and traditional, cmd-tab application switching, but it's still awesome.  I keep all of my chatting applications in one space, Coda in one space, etc.  It's&nbsp;nice.  </p>
<p>The new sideboard just plain old&nbsp;rocks.  </p>
<p>
I've also been using Spotlight for launching applications/documents/websites (a la Quicksilver), which turns out to be surprisingly fast and efficient, even for just-downloaded-and-installed applications.  It's real&nbsp;cool.
</p>
<h3>Portfoliofy</h3>
<p>Finally, I'm in the process of reworking my <a href="/portfolio" title="My Portfolio">portfolio</a>.  This site has a distinct lack of Javascript, but I figured since that was a large part of my skill set, I should include at least a little bit on my site.  The portfolio is now set up slideshow-style.  I'll be working on it more now, and there are some existing issues (it looks a little off in Safari, and I haven't even begun to test it in legacy browsers), but it's fun so&nbsp;far.</p>
<h3>So, what&nbsp;now?</h3>
<p>I've got some ideas.  I'm going to try to start a once-per-week blogging schedule as far as articles go (I know, I know, there is no try, do or do not, etc...), and I'm going to step up my <a href="/linked" title="Linked">linking</a>.  All in all, I'm feeling good about the whole&nbsp;thing. </p>
<p> We'll see what&nbsp;happens.</p>
<img src="http://feeds.feedburner.com/~r/dtott/~4/193169113" height="1" width="1" />]]></description>
      <pubDate>Fri, 30 Nov 2007 22:04:08 -0800</pubDate>
      <guid>http://virb.com/danieltott/posts/text/349870</guid>
    </item>
    <item>
      <title>Cleveland Has A New CSS Off Winner!</title>
      <link>http://virb.com/danieltott/posts/text/266068</link>
      <description><![CDATA[<p>Congrats to <a href="http://www.braddielman.com/" title="Brad Dielman">Brad Dielman</a> for <a href="http://cssoff.com/2007/10/11/and-the-winner-is-brad-dielman/" title="And The Winner is Brad Dielman">pulling in the win</a> in this month's CSS Off. Attention to detail, clean code, and a sly use of <a href="http://microformats.org/wiki/hreview" title="hReview microformat">hReview</a> helped Brad in the newest victory for Cleveland.  Nice work,&nbsp;Brad!</p>
<p>As you may or may not know, <a href="http://cssoff.com/meet-the-css-off-judges/" title="CSS Off - Meet The Judges">I was one of the judges</a> for this month's contest.  Judging was a very rewarding process for me.  It's one thing to sneer at someone's code and talk about Standards and best practice and everything, but it's an entirely different thing to have to back it up with reasons.  I also strived, when I could, to offer suggestions on how to fix something, instead of just pointing out that it was wrong.  It was a very fun experience, and I'm looking forward to helping out on next month's CSS&nbsp;Off.</p>
<p>Again, congratulations, Brad!  Cleveland repre<em>sent</em>!</p>
<img src="http://feeds.feedburner.com/~r/dtott/~4/168524106" height="1" width="1" />]]></description>
      <pubDate>Thu, 11 Oct 2007 13:43:26 -0700</pubDate>
      <guid>http://virb.com/danieltott/posts/text/266068</guid>
    </item>
    <item>
      <title>New Section: Linked</title>
      <link>http://virb.com/danieltott/posts/text/222402</link>
      <description><![CDATA[<p>You may or may not have noticed, but there is <a href="http://dtott.com/linked" title="Linked on dtott.com">a new section</a> here.  It consists of sites that I have saved to <a href="http://ma.gnolia.com/people/danieltott/bookmarks" title="Dan on Ma.gnolia">my Ma.gnolia account</a>.  Every day, I find things on the web that I want to share with people, but I haven't wanted to clutter up my blog to do so.  The solution is Ma.gnolia.  There's <a href="http://feeds.feedburner.com/dtott-linked" title="Dan's Ma.gnolia Feed">a feed</a> and everything.  I hope you find it&nbsp;useful/interesting.</p>
<img src="http://feeds.feedburner.com/~r/dtott/~4/156284497" height="1" width="1" />]]></description>
      <pubDate>Fri, 14 Sep 2007 04:38:37 -0700</pubDate>
      <guid>http://virb.com/danieltott/posts/text/222402</guid>
    </item>
    <item>
      <title>CSS Off Judging</title>
      <link>http://virb.com/danieltott/posts/text/220278</link>
      <description><![CDATA[<p>So here's some good news.  The guys over at CSS Off <a href="http://cssoff.com/2007/09/12/meet-the-css-off-judges/" title="Meet The CSS Off Judges - CSS Off">recruited five judges</a> to help out, including yours truly.</p>
<p>I'm really excited for the chance to help out with this project.  We have <a href="http://cssoff.com/meet-the-css-off-judges/" title="Meet The CSS Off Judges">a good group of people</a> who are all active in CSS Off as well as the blogging community, so it'll be fun to put all of our heads together and read some code! </p>
<p>Ok so we're all probably huge nerds as well...but I've never been one to deny that about myself(:</p>
<p>Anyway, like I said before, the next contest starts at 12:01 am CST (1:01 am EST) on September 15.  That basically  means twelve (one) in the morning on this Friday night.  I'll see you all there!</p>
<img src="http://feeds.feedburner.com/~r/dtott/~4/155645117" height="1" width="1" />]]></description>
      <pubDate>Wed, 12 Sep 2007 21:02:22 -0700</pubDate>
      <guid>http://virb.com/danieltott/posts/text/220278</guid>
    </item>
    <item>
      <title>CSS Tip #1: Use A Reset</title>
      <link>http://virb.com/danieltott/posts/text/217291</link>
      <description><![CDATA[<p>So I've been thinking for a while about what I'd like to blog about, now that I'm at least comfortable (if not perfectly happy) with the presentation of dtott.com.  What I decided on is starting an ongoing series of in-depth CSS tips.  This will (obviously) be the first one.</p>
<h3>What's A Reset?</h3>
<p>A CSS reset is a set of CSS declarations designed to strip away all possible default formatting before adding any of your own.  Every browser out there has default formatting for every HTML element.  The body element in almost every browser has padding, margins, a set font size and color, and a set background color.  Headings have margins, padding, different font sizes, and different font weights.  Turn of CSS on your browser while viewing a site, and you'll see the default CSS that the browser uses.  What the reset does, then, is strip all of that away.  Headings, paragraphs, fieldsets, and everything else, set to one font, one size, one weight, and no extra paddings and margins.</p>
<h3>But...Why?</h3>
<p>Well, there's a few reasons.  First, by resetting the CSS, you remove the temptation to rely on browser defaults that may or may not be the same cross-browser.  H1s, at least to the naked eye, are pretty consistent across the field.  What about fieldsets or dls?<br />
Second, removing that temptation will make you a better CSS coder.  By having to explicitly set each attribute on each element you want to use, it forces you to learn what you might normally gloss over.<br />
Third, it will make your code meaner and cleaner.  You won't have to set the margin and padding every time you use a ul unless the design calls for it.  No more wasting lines and time undoing what the browser does for you.</p>
<h3>OK, I'm Sold.  What Now?</h3>
<p>Go out there and get a reset!  If you are a control-freak-ninja-CSS-master, you could write your own, but there's no need for this.  <a href="http://meyerweb.com" title="Eric Meyer">Eric Meyer</a> has already done it for us: <a href="http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/" title="The Eric Meyer CSS Reset">The Eric Meyer CSS Reset</a>.  Is this the only one?  No. The <a href="http://developer.yahoo.com/yui">Yahoo! User Interface Library</a> has <a href="http://developer.yahoo.com/yui/reset/" title="YUI Reset">a reset</a>, and I'm sure there are more out there.  Eric's is the best.  I could go into why, but it's already been done <a href="http://meyerweb.com/eric/thoughts/2007/04/18/reset-reasoning/">here</a> and <a href="http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/">here</a> (including the comments).  Just go, get the code, and put it above your stylesheets.</p>
<h3>Cool!</h3>
<p>I concur.  Do you concur?</p>
<img src="http://feeds.feedburner.com/~r/dtott/~4/154777888" height="1" width="1" />]]></description>
      <pubDate>Mon, 10 Sep 2007 23:47:53 -0700</pubDate>
      <guid>http://virb.com/danieltott/posts/text/217291</guid>
    </item>
    <item>
      <title>Next CSS Off Is September 15</title>
      <link>http://virb.com/danieltott/posts/text/212925</link>
      <description><![CDATA[<p>The CSS Off guys announced today that <a href="http://cssoff.com/2007/09/07/next-contest-is-september-15-2007/">the next contest</a> will begin on September 15.  Wooo!</p>
<img src="http://feeds.feedburner.com/~r/dtott/~4/153580841" height="1" width="1" />]]></description>
      <pubDate>Fri, 07 Sep 2007 17:57:35 -0700</pubDate>
      <guid>http://virb.com/danieltott/posts/text/212925</guid>
    </item>
    <item>
      <title>Google Reader Has Been Fixed</title>
      <link>http://virb.com/danieltott/posts/text/211051</link>
      <description><![CDATA[<p>I'm not sure if anyone noticed, but <a href="http://google.com/reader">Google Reader</a> now has a search bar.  Those of you who use it should be jumping up and down for joy.  Those of you who chose another reader because for some unknown reason Google  didn't include a search with their RSS aggregator can finally come back home.  </p>
<img src="http://feeds.feedburner.com/~r/dtott/~4/153035496" height="1" width="1" />]]></description>
      <pubDate>Thu, 06 Sep 2007 16:38:29 -0700</pubDate>
      <guid>http://virb.com/danieltott/posts/text/211051</guid>
    </item>
    <item>
      <title>Thinking In Ems</title>
      <link>http://virb.com/danieltott/posts/text/205074</link>
      <description><![CDATA[<p>Well, I made it almost a month since the last design change.  However, this redesign is a little more extensive.</p>
<h3>The Little Stuff</h3>
<p>First, I went to an all-Helvetica font scheme.  My typography was all over the place on the last view versions, and I feel much more comfortable with choosing one font and sticking to it.  Second, but related, I moved the title and navigation to their own bar under the opening graphic, and moved the quotes under the section heads to the right of the section heads.</p>
<h3>The Grid</h3>
<p>The next thing I needed to change was the vertical spacing.  I chose 1.5 ems as my baseline height, and went with it.  Everything now lies on a 1.5 em baseline grid.  You can imagine (or maybe you know from experience) that this seems like it could be a pain.  It is.  What was my secret weapon?  <a href="http://robgoodlatte.com">Rob Goodlotte</a>'s <a href="http://robgoodlatte.com/2007/07/31/syncotype-your-baselines/">Syncotype</a>.  What it does is place a horizontal grid over the page you're viewing, at any size you'd like.  1em converts to 16px, so I was able to line everything up to a 24px horizontal grid.  It's awesome.</p>
<h3>The Em</h3>
<p>The biggest change, which might not be all that visible at first, is that the entire site (except for a couple borders) is now in ems. The entire structure, the images, and of course the fonts, now resize with the text.  The effect is that when you increase font size in your browser, the entire web site zooms.   Try it out (cmd/apple + to increase size, cmd/apple - to lower size).</p>
<p>Seems like an easy concept;  just divide all of your pixel values by 16, like I mentioned before, and you're set, right? Well, at first, yes.  For the overall structure, that's all I had to do.  The problems arise when you change the font size of an element. Whenever you change the font size of an element, like a paragraph or a heading, the rest of the attributes of that element are measured against the new font size, instead of the body font size.  To get the margin or padding that you want, you have to divide the margin you'd like by the new font size, and that number is your new margin.  <strong>Ideal margin / new font size = New margin</strong>.</p>
<p>I had my calculator program running the entire time.</p>
<p>Inspiration and guidance for this redesign came from <a href="http://www.wilsonminer.com/" title="Wilson Miner">Wilson Miner</a>'s <a href="http://www.alistapart.com/articles/settingtypeontheweb" title="Setting Type On The Web">Setting Type On The Web</a> (on <a href="http://www.alistapart.com/" title="A List Apart">A List Apart</a>) and <span class="fn">Richard Rutter's </span><a href="http://24ways.org/2006/compose-to-a-vertical-rhythm" title="Compose To A Vertical Rhythm">Compose to a Vertical Rhythm</a> (on <a href="http://24ways.org/" title="24 Ways">24Ways</a>).</p>
<p>It's been a fun (and trying) experiment.  Hopefully this version  will last longer than a month before I'm fed up with it!</p>
<img src="http://feeds.feedburner.com/~r/dtott/~4/151478299" height="1" width="1" />]]></description>
      <pubDate>Mon, 03 Sep 2007 04:03:16 -0700</pubDate>
      <guid>http://virb.com/danieltott/posts/text/205074</guid>
    </item>
    <item>
      <title>Transparent Favicon Update</title>
      <link>http://virb.com/danieltott/posts/text/203330</link>
      <description><![CDATA[<p>Turns out that there's an even easier way to create <a href="http://dtott.com/thoughts/2007/08/29/transparent-favicons/">transparent favicons</a> (assuming you have photoshop):]]></description>
      <pubDate>Sat, 01 Sep 2007 15:18:43 -0700</pubDate>
      <guid>http://virb.com/danieltott/posts/text/203330</guid>
    </item>
    <item>
      <title>Transparent Favicons</title>
      <link>http://virb.com/danieltott/posts/text/199034</link>
      <description><![CDATA[<p>So I discovered the other day that it is possible to make transparent <a href="http://en.wikipedia.org/wiki/Favicon">favicons</a>.  Favicons are a good idea.  Transparent favicons are just awesome.</p>
<p>Here's a screenshot of my site in a Firefox tab with my original favicon:</p>
<div class="post_image_container">
<p><img src="http://dtott.com/thoughts/wp-content/uploads/favicon_old.jpg" alt="Old Favicon" /></p>
</div>
<p>As you can see, it looks fine in the location bar, but you can see the white square of the favicon on the tabs (especially when a tab is not selected).  Here's the new version:</p>
<div class="post_image_container">
<p><img src="http://dtott.com/thoughts/wp-content/uploads/favicon_new.jpg" alt="New Favicon" /></p>
</div>
<p>Much better!  Want to know how to do it?</p>
<p><a href="http://blog.joesgoals.com/2006/10/26/quick-guide-to-making-a-transparent-favicon/">Go here</a>.  I was going to try to explain it, but his step-by-step is really the best way to go about it.  Let's see what you can come up with!</p>
<img src="http://feeds.feedburner.com/~r/dtott/~4/149758733" height="1" width="1" />]]></description>
      <pubDate>Wed, 29 Aug 2007 17:48:07 -0700</pubDate>
      <guid>http://virb.com/danieltott/posts/text/199034</guid>
    </item>
  </channel>
</rss>
