westman Posted February 28, 2012 Share Posted February 28, 2012 hi all,i am using dream weaver 5.5 to mack roll over images.i upload them to my site and they dont always work,they work sometime and over times they dont. what is the best way to get a roll over image to work 100% of the time? Link to comment Share on other sites More sharing options...
thescientist Posted February 28, 2012 Share Posted February 28, 2012 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 More sharing options...
knystrom18 Posted February 29, 2012 Share Posted February 29, 2012 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? Link to comment Share on other sites More sharing options...
Don E Posted February 29, 2012 Share Posted February 29, 2012 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.. Link to comment Share on other sites More sharing options...
knystrom18 Posted March 1, 2012 Share Posted March 1, 2012 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.