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.


 Subscribe in a reader

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

Notices




Reply
 
LinkBack Thread Tools
  #1  
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Mar 3rd, 2007, 15:08
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
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/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Mar 5th, 2007, 12:26
Elite Veteran
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Mar 5th, 2007, 16:01
Elite Veteran
Join Date: Aug 2005
Location: That Place
Posts: 2,044
Blog Entries: 1
Thanks: 0
Thanked 37 Times in 37 Posts
Re: CSS image rollover problems when using hrefs

Hoot-Nanny! Wooo!
__________________

Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)

Last edited by moojoo; Mar 8th, 2007 at 21:48.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Mar 5th, 2007, 20:39
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS image rollover problems when using hrefs

Silly moojoo, I already promoted your example
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
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
Re: CSS image rollover problems when using hrefs

leave him alone he's illiterate and legally blind
Just kidding!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Mar 8th, 2007, 21:48
Elite Veteran
Join Date: Aug 2005
Location: That Place
Posts: 2,044
Blog Entries: 1
Thanks: 0
Thanked 37 Times in 37 Posts
Re: CSS image rollover problems when using hrefs

I never learned to read! So um.. Did it help?
__________________

Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Mar 9th, 2007, 11:45
Elite Veteran
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
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 20:05.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization 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