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 3 of 3

Thread: hover event

  1. #1
    Regular Coder
    Join Date
    May 2009
    Posts
    164
    Thanks
    75
    Thanked 1 Time in 1 Post

    hover event

    Hi, say I have
    Code:
    <a class="mylink" href="#">Business Class</a>
    And to style the button I do
    Code:
    .mylink{
    ...
    }
    How can I handle the hover event just for this class? I have tried the following without success
    Code:
    .mylink a:hover{
    ...
    }
    
    .mylink:hover{
    ...
    }
    Cheers

  • #2
    Regular Coder
    Join Date
    Jul 2012
    Location
    London
    Posts
    473
    Thanks
    4
    Thanked 86 Times in 86 Posts
    You can't do it the first way but the second way will work fine!

    Code:
    mystyle:hover {color:brown;}
    
    <a href="#" class="mystyle">Link</a>
    This will work fine!

  • #3
    Regular Coder
    Join Date
    Dec 2010
    Posts
    424
    Thanks
    22
    Thanked 56 Times in 56 Posts
    the proper way should be like this

    Code:
    a.mylink:hover { }


  •  

    Posting Permissions

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