4 Sep 2006 at 19:25 #1 nickels nickels Associate Joined 18 Aug 2004 Posts 1,886 Location midlands hi, is there anyway i can make an image change to another image when the mouse hovers over it, with out using javascript?? thanks nickels
hi, is there anyway i can make an image change to another image when the mouse hovers over it, with out using javascript?? thanks nickels
4 Sep 2006 at 19:52 #2 EirePlane EirePlane Associate Joined 3 Aug 2006 Posts 610 Location London, UK You can use CSS to do it as far as I am aware. use a div and give it a class so it reads something like: Code: <div class=img1></div> then in the css file you could add Code: div.img1 { background:url('http://www.yoursite.com/image.jpg'); } div.img1:hover { background:url('http://www.yoursite.com/image2.jpg'); } never tried it myself but it works in theory if I ahve got the ":hover" part right
You can use CSS to do it as far as I am aware. use a div and give it a class so it reads something like: Code: <div class=img1></div> then in the css file you could add Code: div.img1 { background:url('http://www.yoursite.com/image.jpg'); } div.img1:hover { background:url('http://www.yoursite.com/image2.jpg'); } never tried it myself but it works in theory if I ahve got the ":hover" part right
4 Sep 2006 at 20:32 #3 iCraig iCraig Permabanned Joined 21 Apr 2004 Posts 13,312 Location Wolverhampton I don't think that will work. Anchor links support hover better, especially on older browsers. Code: <a class="google" href="www.google.com" title="Click here for Google lol">Google</a> Code: a.google:link, a.google:visited, a.google:active, a.google:hover { width: 100px; height: 100px; display: block; color: #fff; background-image: url(/images/google.gif); } a.google:hover { background-image: url(/images/google_hover.gif); }
I don't think that will work. Anchor links support hover better, especially on older browsers. Code: <a class="google" href="www.google.com" title="Click here for Google lol">Google</a> Code: a.google:link, a.google:visited, a.google:active, a.google:hover { width: 100px; height: 100px; display: block; color: #fff; background-image: url(/images/google.gif); } a.google:hover { background-image: url(/images/google_hover.gif); }
4 Sep 2006 at 20:39 #4 nickels nickels Associate OP Joined 18 Aug 2004 Posts 1,886 Location midlands thankyou got it working nickels