PDA

View Full Version : :hover question


oracleguy
07-08-2003, 06:59 PM
Is there some way I can make just regular text change on mouse over using CSS?

I tried this:

blah:hover { text-decoration: underline; }

<span class="blah">My Text</span>

But that didn't work.

I thought you could use :hover on more than just links.

Oh, and the solution has to work in IE.

Vladdy
07-08-2003, 07:37 PM
Sorry, in dumb IE hover style works only with <a> element. :mad:

ReadMe.txt
07-08-2003, 07:42 PM
a.normal {
the same styles as your p declaration
text-decoration: none;
}

a.normal:hover {
hover styles for normal text
}

oracleguy
07-08-2003, 08:21 PM
Originally posted by Vladdy
Sorry, in dumb IE hover style works only with <a> element. :mad:

I had a feeling you were going to say that. :mad: I guess I'll have to figure something else out.

ReadMe.txt
07-09-2003, 07:47 PM
ahem, you just use an <a> but dont specify the href....

bradyj
07-09-2003, 09:50 PM
ReadMe.txt is right:

Just do it like so:
a.blah:hover { text-decoration: underline; }


That will work just fine.

oracleguy
07-09-2003, 10:05 PM
Originally posted by ReadMe.txt
ahem, you just use an <a> but dont specify the href....

Tried that... it doesn't seem to do it.

bradyj, my question was if it were possible without using the <a> tag.

bradyj
07-09-2003, 10:09 PM
Ah, sorry about that, I misread the flow of conversation a bit;)

Then Vladdy is correct, your stuck with IE's implementation. If you hear of a way around it, post it up, I'd be interested to see:thumbsup:

oracleguy
07-09-2003, 10:16 PM
Originally posted by bradyj
If you hear of a way around it, post it up, I'd be interested to see:thumbsup:

IE7. :)

Vladdy
07-09-2003, 11:09 PM
Originally posted by oracleguy
IE7. :)
nah, MS will find a way to screw it up :D :D :D

Roy Sinclair
07-10-2003, 02:40 PM
Originally posted by oracleguy
IE7. :)

Which evidently won't be available unless you buy the next version of Windows (the one after XP) since MS has decided that new versions of IE will only come with new versions of OSes.

ReadMe.txt
07-10-2003, 08:14 PM
i see what the problem is, try this:


<style>
p {
color: black;
}
a.norm {
text-decoration: none;
color: black;
}
a.norm:hover {
color: red;
pointer: arrow;
}
</style>
<a href="javascript:void(0)">Rollover text</a>


NOTE: it's turned javascript into 2 words so u'll need to make it one word again

another option might be to do something like this:

<span onmouseover="this.color = 'white'" onmouseout="this.color = 'black'>Rollover text</span>

oracleguy
07-10-2003, 08:19 PM
Originally posted by Roy Sinclair
Which evidently won't be available unless you buy the next version of Windows (the one after XP) since MS has decided that new versions of IE will only come with new versions of OSes.

That's pretty dumb. Considering most poeple don't realize they need to update their browser, how does making it so you have to pay 300 bucks for IE7 gonna convince people to upgrade. But of course we are talking about M$

ReadMe, I'll give that a try.

oracleguy
07-10-2003, 08:37 PM
Yep, that solved it for now. Thanks. The javascript did the trick.