--- comments: true date: 2011-08-18 12:50:27 layout: post slug: good-developers-are-illusionists title: Good developers are illusionists wordpress_id: 3027 categories: - Web Development tag: - CSS - HTML --- A major part of being a good developer is efficiency. Not just with efficient code, but efficiency in making your life easier, being cleverly lazy, and making code do the hard work for you. A good way to be efficient is through illusion. A great example of this is faux columns; overcoming a complex problem with minimal code and a clever illusion. Faux columns is still, today, one of the best little bits of web development illusion which quickly solves a problem that would otherwise take a lot of time and markup. Illusion is efficiency. Another practical example of this is something I helped someone out with recently and have actually built myself for use at work. I'm sure we've all seen search forms laid out like this before:  What we have here is a search button laid over the top of our text input. Or do we...? If we were to use just `` and `` to achieve this effect here we'd need to use some positioning to move the button over the search field, possibly some `z-index`, some big paddings to stop text going underneath the button and, more than likely, a lot of hard-coded numbers, cross-browser issues and headaches. Enter the magic of illusion. Here's how I tackled that problem:  Instead of trying to make two sibling elements appear as though one contains the others, why not spoof the effect with an element that _does_ contain it; the `