views:

138

answers:

1

I'm trying to create a chat room with emoticons. When a user types an emoticon such as :) in the chatroom, the CSS takes the proper image off the sprite sheet. But my code only seems to work in Opera and IE (odd combination). It doesn't show in Firefox or Chrome (if you manage to hone in exactly where the image should be, you can find the image blank.gif which is used as the stand-in to place the background-url over). Does anyone know what might cause this in Firefox/Chrome?

Site: ttony21.byethost24.com

Relevant CSS:

image.emo {
  width:19px;
  height:19px;
}
image#smile {
  background:url(img/diceSprite.png) 0 0;
}
image#bigsmile {
  background:url(img/diceSprite.png) -19px 0;
}
etc...

Relevant HTML:

<img class="emo" id = "smile" src="img/blank.gif" width="1" height="1" alt=":)" title=":)" />
<img class="emo" id = "bigsmile" src="img/blank.gif" width="1" height="1" alt=":D" title=":D" />
etc...
+2  A: 

change

image.emo {
  width:19px;
  height:19px;
}

to

img.emo {
  width:19px;
  height:19px;
}

and the others follow a similar pattern. The element selector is img, not image

Robusto
Wow. You're right. I'm sorry for wasting your time with that one XD I didn't notice because it didn't cause any other bugs.
ttony21
So if that did the trick, you could consider giving me the check mark. And it's a mistake all of us have made at one time or another, I'm sure. :)
Robusto
It's usually the little things that matter the most. Forgetting that it's img instead of image happens to all of us from time to time. Good catch Robusto.
wilwaldon
Really, I blame W3C for calling that tag "img" in the first place. I can't tell you how many times I've had that "duh" moment when realizing I made the same mistake you did. In my mind, "img" is pronounced "image"!
Robusto