Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
In css, how do I use hover effects with certain divs only?
Old 10-17-2007, 05:19 PM In css, how do I use hover effects with certain divs only?
goheadtry's Avatar
Webmaster Talker

Posts: 726
Name: John
Location: United States of America, California
Trades: 0
Lets say, I have a div for my navigation in my page. How do I make the links look a certain way for that specific div in more than one way?

For example when I hover over the link I want the color of the link to change to yellow

When the link is active it should stay the same as the normal one and still allow hovering.

The visited version of the specific div for my navigation should be the same as the one that is created and used.

When it hovers it should be yellow;
When it is active, normal, or visited it should be the same way too.
__________________
Free $1 gift card when you signup at
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

goheadtry is offline
Reply With Quote
View Public Profile Visit goheadtry's homepage!
 
 
Register now for full access!
Old 10-17-2007, 05:21 PM Re: In css, how do I use hover effects with certain divs only?
l3lueMage's Avatar
Skilled Talker

Posts: 73
Location: San Jose, California
Trades: 0
As you can see from my topic IM struggling to remember CSS xD But I believe this is how you do it...

Code:
classname:link {
    color: #000000;
    text-decoration: none;
}
classname:visited {
    text-decoration: none;
    color: #000000;
}
classname:hover {
    text-decoration: underline;
    color: #000000;
}
classname:active {
    text-decoration: none;
    color: #000000;
}
I think....then you just say div id=classname

Maybe? D; haha...someone will probably correct me.
l3lueMage is offline
Reply With Quote
View Public Profile
 
Old 10-17-2007, 05:28 PM Re: In css, how do I use hover effects with certain divs only?
angele803's Avatar
Perfectly Imperfect

Posts: 1,774
Name: Stephanie
Location: Oklahoma
Trades: 2
bluemage is close. I would do something like:
.classname a:link {
text-decoration: none;
color: #000000;
}

This is saying that any link within an element with the class "classname" would have these attributes.
__________________

Please login or register to view this content. Registration is FREE
angele803 is offline
Reply With Quote
View Public Profile
 
Old 10-17-2007, 05:30 PM Re: In css, how do I use hover effects with certain divs only?
Defies a Status

Posts: 1,605
Trades: 0
An example two classes defined and one used:

Quote:
A.nav-link {
font-size: 10pt;
color: #000000;
font-family: Verdana;
font-weight: normal;
text-decoration: none;
}
A.nav-link:visited {
color:#000000;
}
A.nav-link:hover {
color:#FF0000;
}
A.body-link {
font-size: 10pt;
color: #64825d;
font-family: verdana;
font-weight: bold;
text-decoration: none;
}

A.out-link {
font-size: 10pt;
font-family: Verdana;
font-weight: bold;
text-decoration: none;
}
And then in the html

Quote:
<a class="nav-link" href="filename.html"> Anchor text</a><br>
__________________
Colbyt

Please login or register to view this content. Registration is FREE

Last edited by colbyt; 10-17-2007 at 05:32 PM.. Reason: forgot to edit the css before posting
colbyt is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to In css, how do I use hover effects with certain divs only?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13661 seconds with 12 queries