geek happiness

Posted by on January 6, 2008 in general thoughts | 0 comments

geek happiness

It’s sad… I know… but one of the few things I can do at the moment, is web geekery.

When you can only physically fit your feet (still) into one pair of shoes (hooray for my hiking/mtb boots)… you’re chomping at the bit to be able to go for a swim… you yearn to ride your beloved bicycle along the wintry beach… you don’t know when you’ll be fit again… you have to take small victories when they present themselves.

To this end, I present 1 line of CSS code, that made me a very happy man…

p img { max-width: 100%; }

Pretty dull eh?

Aha… thats where you’d be wrong if you were limited to simple geek pleasures… adding that line of code to the stylesheet of your blog means that no more can an image over-run its boundaries!

Example… before this line of code was added, this picture below, would of stuck out n looked all weird, if you click the pic it’ll show you it at full 1024×768 size… this simple line of code means it displays it here, shrunk to fit, without me doing anything! Woooo! (right click it, view pic to see it is actually that big if you really want)

Bomo beach in the winter

That in itself is not so great… but… add this feature to your client (friends and family) sites, and it means they cant bugger up the look n feel by accidentally inserting pics that are too large! It makes it even more idiot proof.

Sad… but made me happy. Like some sort of itch I couldn’t quite reach for ages, I knew it could be done… but couldn’t quite get it to work… now… its fixed… and it made me happy. Wow, what a loser!

…before I go, the answer to your questions is “I feel a bit better in myself, but symptom wise… about the same. Still generally creaky and my feet are still swollen making movement painful. I’m waiting to get my appointment with the rheumatologist, which’ll hopefully make me more mobile.”

Update:so I uploaded this page, then added the css to see the change, which of course meant some people had a cached version of this page without the clever formatting. If you get the extra large weird pic, hit refresh on your browser.

Update2: adding .storycontent { overflow: hidden; } will ensure that if the browser doesn’t support max-width (which it turns out some don’t… stupid non-standard browsers…) it’ll truncate the pic rather than display it sticking out… unless you’re on ie5… stupid microsoft…

update3: (I really don’t let things beat me, do I!?) Fixed for older non-standard browsers… also add: width: expression(this.width > 450 ? 450: true); to the p img tag…. wooop. (450 being the width of my column, % values don’t work in this expression)

Leave a Comment

Your email address will not be published. Required fields are marked *