Need CSS help. A problem with hover color...
Is anyone well versed in CSS can give me a hand figuring out why I cannot get a hover color set on a link?
This isn't working in the application:
<style>A:hover { color:red}</style>
There is a space in "{ color:red}".
Anhanga Brasil wrote:
There is a space in "{ color:red}".
I thought they were space insensitive.?
EDIT: Nope, not the problem...
Longshadow wrote:
I thought they were space insensitive.?
EDIT: Nope, not the problem...
Wait... it is case-sensitive. Try changing "A" to "a".
Long time since I did any CSS, but try this:
<style>a:hover {color:red;}</style>
juan_uy wrote:
Long time since I did any CSS, but try this:
<style>a:hover {color:red;}</style>
I have the statement with the capital working at another site.
This one uses CSS for a side pop-out menu.
I'm suspecting the other CSS is having an affect.
Thanks for trying.
Longshadow wrote:
I have the statement with the capital working at another site.
This one uses CSS for a side pop-out menu.
I'm suspecting the other CSS is having an affect.
Thanks for trying.
My change is not the lower-case a (that's just what I used to do), but I added a ";" that I understand was missing.
juan_uy wrote:
My change is not the lower-case a (that's just what I used to do), but I added a ";" that I understand was missing.
The ; is right after red, within the braces.
Longshadow wrote:
The ; is right after red, within the braces.
Yes, it was what I added. It wasn't present in the code you pasted.
Hope that makes it.
This works for me:
<style>
a:hover{color:red;}
</style>
Works with or without the ; or space before red...
I'm confused, but I think it may be an odd interaction with the CSS code I'm using for the "MENU". I would like the green "MENU" to change to red upon mouse-over (hover).
The statement <style>A:hover { color:red}</style> works great in other sites that do NOT used the menu code used here, and here unrelated to the menu code (someplace else on the page). I use PHP includes to get some of the contents the same across all pages so I only have to edit one page for the changes to be across all pages.
You should be able to view the page source at the site and see ALL of the included code pulled into the page.
No real biggie as the site works fine, just one of those WTF moment things.....
Thanks to anyone who wants to try to figure it out!
(I wonder if I tries using W3Schools on-line "try-it" editor if I can play with it there.)
https://cvrhs.com/
I have looked at your page and it's source. The menu items change to red when they are moused over. I use Chrome. What browser are you using?
I tried edge and opera as well and they work OK...
Ed
edrobinsonjr wrote:
I have looked at your page and it's source. The menu items change to red when they are moused over. I use Chrome. What browser are you using?
I tried edge and opera as well and they work OK...
Ed
The menu list items do change, I'm trying to get the menu link in the center of the page that opens the menu to change to red on hover. It remains green.
(I'm using Firefox.)
I've tried placing the <style>A:hover { color:red}</style> in various places within the body (top), and the menu code area, still remains green.
Just like to know what I'm missing!
Will try to deal with that now that I understand...
If you want to reply, then
register here. Registration is free and your account is created instantly, so you can post right away.