The code looks correct. My guess would be you have some other issue. Try making a working html page that demonstrates the issue. Make it as minimal as possible. You’ll probably figure out your issue while preparing it.
The original code is actually a part of a WP theme so the # is actually some PHP.
I tested it out and it is not working. I made a basic html page and switched the codes. Only works when it’s a div. I even put the .thumb in the <a> instead and nothing. Hm.
I have another question. The code entails a <img> tag however when I view it in Firebug, it turns that <img> into a div with a background-image. However when I do a traditional “view source” it’s just an <img> tag again. Does anyone understand why that is? I sense this is the actual problem.
You probably have some javascript which modifies the page. This is exactly the reason i said to make a minimal demonstration. Pretend you have entered a contest, and the goal is to use the least amount of characters to demonstrate your problem. The end result should be very small.
Well, you were right. I didn’t simplify the code thoroughly enough and apparently it was this “baseline img” JS fix that messed it up. Damn, that delayed me. Thanks.