Jump to content

roll over image


westman

Recommended Posts

CSS and psuedo-classes. and not being able to see your code, there's no way to know why it's not working, although generated DW code is most likely the culprit.

Link to comment
Share on other sites

I've never experimented with pseudo classes for rollovers before until tonight and I found only divs and links to work for me.Code:

<html><head><style type="text/css">div.roll-over {  background-image: url(img1.jpg); /*EDIT: img1.jpg and img2.jpg are attached for funsies!*/  width: 126px;  height: 126px;}div.roll-over:hover {  background-image: url(img2.jpg);}a#roll-over:link, a#roll-over:visited {  width: 126px;  height: 126px;  display: block;  background-image: url(img1.jpg);} a#roll-over:hover {  background-image: url(img2.jpg);}</style><title>W3S Example</title></head><body>  <div class="roll-over"></div>  <br />  <br />  <a id="roll-over" href="#"> </a></body></html>

So, to supplement westman's question, will pseudo classes work with anything else other than divs and links?

post-36086-0-58307500-1330488730_thumb.jpg

post-36086-0-68334800-1330488735_thumb.jpg

Link to comment
Share on other sites

Try <p> tag instead and see if it works as well.. or <h1> etc.. For sake of quirks mode, make sure you add a doctype..
Yea, I usually use strict, but I just hand typed that out of desire for a quick answer. *Upon experimentation* - It seems to be that all block-level elements can make use of :hover... Sweet!
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...