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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    link with italic and regular font - hover doesn't work

    Hello Forum

    This is a very basic thing that I thought always worked... then again I don't remember actually having to do this before.

    I have a link in the navigation which contains both italic and regular fonts. The rollover state however doesn't seem to work. The italic font doesn't change color on rollover. When I rollover the regular font however both the italic and the regular font change colors... strange..

    This is my code:
    [CODE]

    [...]
    <li><a href="http://DOMAIN:8888/my-link" class="nav_off"><span class="italic">Product Name&trade;</span> Information</a> | </li>

    [...]


    a.nav_off,a.nav_off :link,a.nav_off :visited,a.nav_off :hover,a.nav_off :active{color: #fff;}
    a.nav_on,a.nav_on :link,a.nav_on :visited,a.nav_on :hover,a.nav_on :active{color: #0f0f0f;}
    nav ul li a:hover {color: #0f0f0f;}
    [CODE]


    Any ideas what I might be doing wrong or a better way to set this up?

    Thank you for reading this

    Th0m

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,862
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    There shouldn't be any space before the pseudo selector, if you are applying the style on the same element.

    In your case,
    Code:
    a.nav_off :visited,a.nav_off :hover
    are equivalent to
    Code:
    a.nav_off  *:visited,a.nav_off *:hover
    .

    btw, I don't get your actual intention from the CSS. I think you need some thing like
    Code:
    a.nav_off:link,a.nav_off:visited{
    color: #fff;
    }
    a.nav_off:hover,a.nav_off:active{
    color: #0f0f0f;
    }
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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