Daily Archives: Thursday 21/01/2010

The Never Diminishing Laundry Basket My Life 21 JAN 2010

I think my mom would probably have killed me had I still been living with her and generating the huge amount of laundry that I currently come up with on a daily basis. As it is, I think Chantelle could quite possibly be hating it as well – though luckily in our house it’s basically the person who is home or gets home first that needs to see to the laundry, meaning its pretty much equal opportunity at the moment.

But I am serious but this seemingly never ending pile of dirty washing that seems intent on taking over our bedroom when we take our eyes off the washing basket for even just a minute.

Ever since increasing my gym routine to mornings and lunch (and sometimes even after work as well), the number of sweaty, stinky t-shirts, underpants and socks just never seem to stop coming in, and when combined with a sweaty dogi twice a week and the usual daily work golf shirt and underpants… well you get the picture.

The number of items needing a wash has increased so drastically that I’ve even had to go out and buy a second Venus clothes hanger in order to pin everything up and I swear if I had the space, a large LG clothesdryer would already be sitting there in all of its glory. (Or perhaps I should just invest in one of those washing machine/dryer combo units?)

Anyway, the point of this all is that had I still been living with Mom I’m sure she’d have killed me by now – or simply given up! :)

(P.S. It’s been two weeks now and my stomach has still NOT recovered from that stomach bug that struck me down last Monday! Icky. Oh, and Christmas trees are going for 75% off at Woolworths – we’ll hopefully get one today or at least by the end of the week! Better late than never I say! :P)

!important CSS: How to force one Style above Another CodeUnit 21 JAN 2010

In CSS, how do you force a particular style declaration to take precedence over all others that have come before or after it?

Remember the very nature of Cascading Style Sheets is to cascade. Hierarchy is important and if a style is read by the browser after a previous style declaration affecting the same element has already been submitted, then I’m afraid it will be that last style read that will be applied.

But how about when you want to dynamically adjust styles? Or what if you want a particular style to always crow king, even if it wasn’t the last style read in?

Well luckily CSS brings with it the nifty !important rule which, although primarily targeted as a usability tool (Google the concept of User versus Author stylesheets), hands us the power to force a particular style to be applied, regardless of whether or not it gets overridden at a later stage.

To give an example as to its usage, let’s look at the following style declaration:

p { color: #ff0000; }
p { color: #000000; }

This stylesheet will result in all paragraph text being  printed in black, despite the first attribute assigning it’s color to that of red.

However, let’s add the !important rule into the mix:

p { color: #ff0000 !important; }
p { color: #000000; }

Believe it or not, all paragraph text has now changed from the previous black to red. Fantastic, exactly what we were hoping for! :)