Hi,
First, I am a bit confused about the behavior of floated items. I know during the in class demo there were non-floated items hiding behind floated items. I am trying to make a series of photos float directly over a series of photos which are positioned the same way and are the same size, but I can’t seem to make it happen. I suspect it is because in the demo it was just colored boxes with no other content, but the pictures, being content, behave differently. right? wrong?
I may be on the wrong track altogether. What I’m trying to do is have a series of pictures and when you hover on a picture, it displays a different picture. I thought perhaps by having pictures underneath and making the top picture diapear when hovering would do the trick. no?
Any advice would be very much appreciated. Thanks and sorry for writing a novel.
I would use a CSS sprite:
http://www.websiteoptimization.com/speed/tweak/css-sprites/
Or something like the following:
a#example{
display:block;
width:50px;
height:50px;
background-image:url(an_image.jpg);
}
a#example:hover{
background-image:url(another_image.jpg);
}
Comment by joe — May 13, 2009 @ Wednesday, May 13, 2009 8:38 pm
it worked! thank you.
i’ve also been trying to have a sound play while hovering. I’ve successfully embeded audio, but I can’t quite figure out what the rule would be in CSS to have it play. I found something online involving some javascript which looked scary but I was hoping there might a simpler way.
Comment by koconnor — May 14, 2009 @ Thursday, May 14, 2009 6:03 pm