Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-13-2012, 01:26 AM   PM User | #1
nick2price
Regular Coder

 
Join Date: May 2009
Posts: 104
Thanks: 47
Thanked 1 Time in 1 Post
nick2price is an unknown quantity at this point
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
nick2price is offline   Reply With Quote
Old 07-13-2012, 01:42 AM   PM User | #2
tempz
Regular Coder

 
Join Date: Jul 2012
Location: London
Posts: 436
Thanks: 4
Thanked 80 Times in 80 Posts
tempz is an unknown quantity at this point
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!
tempz is offline   Reply With Quote
Old 07-13-2012, 02:25 AM   PM User | #3
aaronhockey_09
Regular Coder

 
Join Date: Dec 2010
Posts: 411
Thanks: 21
Thanked 55 Times in 55 Posts
aaronhockey_09 is an unknown quantity at this point
the proper way should be like this

Code:
a.mylink:hover { }
aaronhockey_09 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:15 AM.


Advertisement
Log in to turn off these ads.