CSS image rollover problems when using hrefs

This is a discussion on "CSS image rollover problems when using hrefs" within the Web Page Design section. This forum, and the thread "CSS image rollover problems when using hrefs are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Mar 3rd, 2007, 13:59
New Member
Join Date: Mar 2007
Location: Twickenham
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
CSS image rollover problems when using hrefs

Bit of a newbie as you'll guess. I'm having problems using CSS to control rollover images in IE when associated with hrefs. Using this code:

a.link:link {
background:url(assets/on.gif) bottom left no-repeat;
}
a.link:hover {
background:url(assets/off.gif) bottom left no-repeat;
}

In FF this lets you roll over text, swap an image and link to another page all in one go.

However, this doesn't work in IE when the href includes a dot (.) suffix. For instance .com/.co.uk/.html/.pdf.
But it does work when you link to something like Skype which has an href of "callto://mark.sk" - see no dot suffix!!

Any ideas out there?
Reply With Quote

  #2 (permalink)  
Old Mar 3rd, 2007, 15:08
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS image rollover problems when using hrefs

That's odd. Could I have a link, please?

The background switch method might help if you're in a pinch. It's better than using two images anyway:

http://www.newguyinennis.com/samples/css_hover/
Reply With Quote
  #3 (permalink)  
Old Mar 5th, 2007, 12:26
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS image rollover problems when using hrefs

I agree with Ryan ... use one image and change the background-position to switch states

Pure CSS rollovers without Javascript
Reply With Quote
  #4 (permalink)  
Old Mar 5th, 2007, 16:01
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,604
Thanks: 0
Thanked 6 Times in 6 Posts
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: CSS image rollover problems when using hrefs

Hoot-Nanny! Wooo!
__________________
I've got <style> and .class

Last edited by moojoo; Mar 8th, 2007 at 21:48.
Reply With Quote
  #5 (permalink)  
Old Mar 5th, 2007, 20:39
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS image rollover problems when using hrefs

Silly moojoo, I already promoted your example
Reply With Quote
  #6 (permalink)  
Old Mar 8th, 2007, 16:34
Reputable Member
Join Date: Dec 2005
Location: Texas
Age: 19
Posts: 328
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to daygon Send a message via MSN to daygon Send a message via Yahoo to daygon
Re: CSS image rollover problems when using hrefs

leave him alone he's illiterate and legally blind
Just kidding!
Reply With Quote
  #7 (permalink)  
Old Mar 8th, 2007, 21:48
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,604
Thanks: 0
Thanked 6 Times in 6 Posts
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: CSS image rollover problems when using hrefs

I never learned to read! So um.. Did it help?
__________________
I've got <style> and .class
Reply With Quote
  #8 (permalink)  
Old Mar 9th, 2007, 08:20
New Member
Join Date: Mar 2007
Location: Twickenham
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS image rollover problems when using hrefs

Sorry Moojoo, been busy testing the new site. I tried the idea of using the one image and changing it's position but I couldn't make it work, it just kind of stuck open if you like. Instead I used an image just in the Hover state. Partly through being a bit of a CSS novice and having a deadline I had to drop a few 'nice to haves'. But thanks anyway, have kept the info for another time!
Reply With Quote
  #9 (permalink)  
Old Mar 9th, 2007, 11:45
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS image rollover problems when using hrefs

It's not really a nice to have it's a nice-not-to-have-lag-time-when-loading-the-hover-image thing

Have a look at my link - Pure CSS rollovers without Javascript - I have sample code.
Reply With Quote
Reply

Tags
css, href, rollover

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] multiple image rollover not restoring image snappy JavaScript Forum 4 Nov 5th, 2007 14:38
css rollover problems danny322 Web Page Design 2 Nov 5th, 2007 11:30
Rollover image with links on new image stoob JavaScript Forum 2 Feb 8th, 2007 22:05
Intermittent rollover problems artdog Flash & Multimedia Forum 3 Sep 11th, 2006 13:05
mouse rollover and sound problems djmichaud Flash & Multimedia Forum 8 Aug 31st, 2006 14:11


All times are GMT. The time now is 03:46.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43