Friday, February 29, 2008

How I made my blogger tag cloud

Tag clouds are what all the cool kids are doing, so I was devastated to find that blogger don't have one in their default widgets, but google came to the rescue and I found another blogger blogger that had worked out how to do it. I followed his instructions and hey presto! a tag cloud as you can observer on the sidebar. However, some of my tags are quite long and I found that they were getting word-wrapped which looked pretty naff, so I tried to find out how to fix that.

First, I tried a bit of javascript string replacing to change the spaces to non-breaking spaces, but couldn't get that to work: it either removed the spaces or replaced them with the text &nbsp; neither of which I wanted. So I wondered if there was a CSS property I could use, and after flirting briefly with the IE-only <nobr> tag I found my answer: white-space:nowrap which I applied to #labelCloud a and my long tags no longer wrapped. Joy and happiness were mine!


Dave Gilbert told me yesterday that I need to ration myself, as I'm doing too many blog posts too quickly. Fortunately, I've now worked out how to change that datestamps on drafts, so I can store up my nuggets of wisdom and release them slowly to my avid readers, so as not to make them too clever too quickly and their brains explode. I'd hate to be responsible for someone having to clean up icky exploded brain off the upholstery.

Oh, and thanks to gnome for the Digg!

No comments:

Post a Comment

Please keep comments clean: foul language means your comment will not get published. Sorry for the captcha, was getting to much spam.