There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Stuck on a CSS MouseOver Problem


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
vidyaishaya's Avatar
Member with 71 posts.
 
Join Date: Oct 2001
24-Mar-2005, 06:10 PM #1
Unhappy Stuck on a CSS MouseOver Problem
I have a client that wants images with links.
No problem.

But... we want to have the image change as the mouse rolls over it. And then click on the "mouseover-ed" image to go to the next page.

(I know... it's not what I'd choose, but the client wants it....)

I can do something like this with text (although the text stays
the same on the mouseover) using borders and background.

But how can I do this with CSS?

I know I need to use an id for:
#nav a:link, #nav a:visited

and a different one for:
#nav a:hover

but how does a different image get specified on the mouse-over?

In the HTML itself? Or in the CSS? Or where?

I'm confused.

Thanks

....Vidya Ishaya
__________________
__________________________________
Editor/Publisher of Web Wise News
http://www.webwisesage.com
tsunam's Avatar
Senior Member with 1,246 posts.
 
Join Date: Sep 2003
Experience: Linux~su
24-Mar-2005, 07:24 PM #2
You can do it in the css, as you would define a background in css you can do that with the a:hover.

something like

background: url("background_top.png");
vidyaishaya's Avatar
Member with 71 posts.
 
Join Date: Oct 2001
24-Mar-2005, 07:36 PM #3
Exclamation Sure, but....
Yes, I thought of that, but then a big question comes up.

How does that background graphic become a link?
As the HREF is specified in the HTML, and it
must have something to be attached to, like
<a href="xyz.htm"><img src="abc.jpg"></a>

How would you link something which is a background
in a CSS tag?

See? That's the problem here?

Thanks

...Vidya
__________________
__________________________________
Editor/Publisher of Web Wise News
http://www.webwisesage.com
tsunam's Avatar
Senior Member with 1,246 posts.
 
Join Date: Sep 2003
Experience: Linux~su
24-Mar-2005, 08:56 PM #4
well you have a couple of options. You can do a

<div links>
<li> this is link one</li>

and have it be a invisible text link, the exact size of the graphic. That'd probably be the easiest. the css would cover the div's invisible text.
Shadow2531's Avatar
Distinguished Member with 2,629 posts.
 
Join Date: Apr 2001
25-Mar-2005, 03:55 AM #5
Do you want something like this?

(that's pure css and won't work in iE)

If you need it to work in IE, you'll have to use a javascript method.
vidyaishaya's Avatar
Member with 71 posts.
 
Join Date: Oct 2001
25-Mar-2005, 12:40 PM #6
Wow. Yes. That's it.
OK, thanks much.

Do you think IE will ever support pure CSS?

...Vidya
tsunam's Avatar
Senior Member with 1,246 posts.
 
Join Date: Sep 2003
Experience: Linux~su
25-Mar-2005, 03:03 PM #7
Nope....they said they won't support full CSS2 in ie 7 because it's not a great standard. They will impliment more of it but not full support. They claim they'll give full support in either 2.1 or 3 but thats a load of bull.
Shadow2531's Avatar
Distinguished Member with 2,629 posts.
 
Join Date: Apr 2001
25-Mar-2005, 09:33 PM #8
You can however run IE7 on the site in question to include javascript and css hacks that allow pure css things like that to work.

I'm not suggesting you do that, just letting you know that there's a way.

Also, you can use a proxy with IE to include IE7 locally so when you visit pages in IE, pure css stuff will automatically work.

Again though, it's not worth it.

(The IE7 I am referring to is the collection of hacks for IE6 and not the next version of IE that will be available for WinXP SP2 and up)
__________________
10 ? "a line as the unending horizon"
20 ? "a curve as the rolling hillside"
30 ? "a point as a distant bird"
40 ? "a ray as the rising sun"
run
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 09:44 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.