Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    a:hover conflict

    I have placed a small text/css script in the head of my index.htm:

    <style type="text/css">
    <!--
    A:hover { COLOR: red; font-weight: none }
    -->
    </style>

    which successfully changes the links on my page to red on mouseover. However, I also have an external CSS script for a vertical dropdown menu on the same page which contains a command for hover, as follows:

    .glossymenu li a:hover{
    background: aqua;
    }

    This command also works successfully to change the sub-menu links on the vertical dropdown menu to aqua color on mouseover.

    The conflict is this: The A:hover for color:red is affecting the links in the dropdown menu. They not only change background color to aqua on mouseover, most the text of them (not all of them) turn red simultaneously.

    So, the question becomes "How can I have my cake and eat it too?" In other words: What do I need to do so that only those links which are not part of the vertical menu turn red on mouseover? This is baffling.

    Thank you one and all.

  • #2
    Regular Coder Jutlander's Avatar
    Join Date
    Jun 2007
    Location
    In my own sick little world :P
    Posts
    425
    Thanks
    1
    Thanked 12 Times in 12 Posts
    First off, you've forgotten a semicolon right after font-weight: none.

    Can you please post all of your code. That will make it easier to get the bigger picture.
    .
    .

  • #3
    New Coder
    Join Date
    Jul 2007
    Location
    USA
    Posts
    83
    Thanks
    6
    Thanked 7 Times in 7 Posts
    Seems to me that the easy solution would be to declare a color for .glossymenu
    links.

    .glossymenu li a:hover { background: aqua; color: #000;}

    P.S. Jutlander, the semicolon is not required after the last declaration at the end of a declaration block. It's actually optional.
    Last edited by lithriel; 07-26-2007 at 07:37 PM.

  • #4
    Regular Coder Jutlander's Avatar
    Join Date
    Jun 2007
    Location
    In my own sick little world :P
    Posts
    425
    Thanks
    1
    Thanked 12 Times in 12 Posts
    Quote Originally Posted by lithriel View Post
    P.S. Jutlander, the semicolon is not required after the last declaration at the end of a declaration block. It's actually optional.
    I don't know, but it is good practice and will leave the most minimal margin for error, possible.
    .
    .

  • #5
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've gone with the easy way, thanks to lithriel. And it works like a charm! Thank you thank you.

    Case closed.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •