Killer Tip Killer Book
In my last post I said that this article would have a killer tip. I lied, it has three.
Killer Tip 1 - CSS Pseudo-elements
I learnt yesterday about the incredible power of CSS pseudo elements. With regards to screen media there are two relevant classes. before and after. So if for example your building an ecommerce site and you wanted to show a size of an item. You could create this code in your markup.
<h3 class="size">12</h3>
And these two lines to your CSS
h3.size:before {content:";Size: ";}h3.size:after {content:"; inches";}
Which would render in a browser/user agent as - Size: 12 inches. This is great for working with database driven content and the killer part is it removes the "Size: " and " inches" text from your markup. Which reduces the page weight slightly, causing the real marketing copy, the stuff that you do want the search engines to index to have a little bit more weight.
Killer Tip 2 - Stylin' with CSS
Killer Tip 1 I culled from a new book on CSS by Charles Wyke-Smith. "Stylin' with CSS - A designer's guide". Is crammed with great practical tips and examples. Like the one that made my footer on this page, move up and down in relation to the size of my content. I just added this before the end of my content wrapper.
<div class="clearfloats"><!-- --></div>
And this new class to my css
.clearfloats {clear: both;}
Charles also has a more sophisticated variation on this technique in his book - the Alsett Clearing method. Which does away with the need for the extra "clearfloats" markup. This is a killer book on CSS
Killer Tip 3 - The Killers
Buy Hot Stuff by The Killers - a killer album if ever I heard one.

