I found the above issue in the code. I believe it was there so that the code looks pretty when editing. But the extra spaces and line breaks have an effect on the browser. The $button and $smileys needs to be all one code line with no spaces or breaks. This is a feature of PHP that works (sometimes) but can cause side effects like this.
I found another fix for this problem that doesn’t involve CSS. It seems that if you remove the line break in between the <A> tags in wpf.class.php in both $buttons and $smileys it works. I’m not sure why this is a problem in some browsers. But if there is a space between the <a> <img> it tends to line break. Change these to <a><img>... </img></a><a>...