Ah, thanks for suggesting to provide a url adam, as it appears that the problem is in the formatting else where in my page, as I've just put the code in a blank page and it works.
So I'll get to checking the rest of my code to see what's what.
Thanks again for your help.
Cheers,
Rich