WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Site Design > Graphics & Design Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Graphics & Design Discussion Forum Post your graphics design questions/comments/ideas in here. Ask questions, post tutorials, discuss trends and best practices. Sub-forum for website accessibility and usability.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-20-2004, 01:16 PM
WebProWorld Pro
 

Join Date: Jan 2004
Location: Empangeni, South Africa
Posts: 124
justinw RepRank 0
Default CSS hover links

I have often seen sites that have different hover effect for links: some have underline and other links in the site have underline and overline.

How is it that there can be more than one hover effect and how can I go about doing it?

Thanks!
__________________
Website designs in Empangeni, South Africa: www.jwdesigns.co.za
Reply With Quote
  #2 (permalink)  
Old 03-20-2004, 01:35 PM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default

Might be with border-top using a:hover, along with text-decoration:underline.
Can you show an example?
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #3 (permalink)  
Old 03-20-2004, 01:46 PM
WebProWorld Pro
 

Join Date: Jan 2004
Location: Empangeni, South Africa
Posts: 124
justinw RepRank 0
Default

OK...... on Webproworld:

The forum links at the top of each page have a hover underline; and the link hover for the newsletter has no underlines
__________________
Website designs in Empangeni, South Africa: www.jwdesigns.co.za
Reply With Quote
  #4 (permalink)  
Old 03-20-2004, 02:04 PM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default

Didn't have far to go!

They probably used two sperate classes as 'selectors' something like this:

.newslinks a:link, a:visited {text-decoration:underline;}

.newslinks a:hover, a:active{text-decoration:none;}

then for each link - ( I will have to use some '*' symbols to stop the examples from turning into real links!)
<*a class="newslinks" href="**">Page One</*a>


Good reference site, this link to relevent page, use links at top to find 'index'
http://www.blooberry.com/indexdot/cs.../selectors.htm
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #5 (permalink)  
Old 03-20-2004, 02:09 PM
splinter's Avatar
WebProWorld Pro
 

Join Date: Jul 2003
Location: UK
Posts: 261
splinter RepRank 0
Default

You need to give the links classes (and if you want, ID's). On one of my sites I have declared this as the defualt style for my links:

Code:
a:Link, a:Active, a:Visited { 
text-decoration: none;
}

a:Hover { 
text-decoration: none;
background-color: #999999;
color: #FFFFFF;
border: 1px #666666 solid;
padding: 0px;
height: auto; 
}

a { 
font-family: Arial, Helvetica, sans-serif; 
font-size: 12px; 
font-style: normal; 
font-weight: bold;
color: #6699CC;
padding: 1px;
}
I don't want this for all the links though. This is the code for some other links:

Code:
#leftcol .fnav a {
background-color: #FFFFFF;
text-align: center;
font-size: 11px;
font-weight: bold;
}

#leftcol .fnav a:Hover { 
color: #6699CC;
text-decoration: underline;
border: 0px;
}
#leftcol is the ID name I use for that area of the page (called by <div id="leftcol">) and .fnav is the class (I use other styles of links within the leftcol ID). The a means those styles apply to all the anchor tags and a:hover is what happens when the links are hovered over.

I hope you understood that. If not, I'm sure I'll be able to explain what you don't understand (or someone else could answer of course :P).
Reply With Quote
  #6 (permalink)  
Old 03-20-2004, 02:10 PM
WebProWorld Pro
 

Join Date: Jan 2004
Location: Empangeni, South Africa
Posts: 124
justinw RepRank 0
Default

so i can put different hover colors for different things?

If it has a:link can I specify the color of that specific link color?
__________________
Website designs in Empangeni, South Africa: www.jwdesigns.co.za
Reply With Quote
  #7 (permalink)  
Old 03-20-2004, 02:26 PM
splinter's Avatar
WebProWorld Pro
 

Join Date: Jul 2003
Location: UK
Posts: 261
splinter RepRank 0
Default

Use this:

Code:
.link1 {
color: #[colour];
}
.link2 (
color: #[colour];
}
etc. etc.
and then the HTML code:

Reply With Quote
  #8 (permalink)  
Old 03-20-2004, 02:34 PM
WebProWorld Pro
 

Join Date: Jan 2004
Location: Empangeni, South Africa
Posts: 124
justinw RepRank 0
Default

is it possible for me to make each link with its link color and hover color in each piece? eg:

.link1 {
color: #[colour];
a:hover:#[hover colour]
}
.link2 (
color: #[colour];
a:hover: #[hover colour]
}
__________________
Website designs in Empangeni, South Africa: www.jwdesigns.co.za
Reply With Quote
  #9 (permalink)  
Old 03-20-2004, 02:41 PM
splinter's Avatar
WebProWorld Pro
 

Join Date: Jul 2003
Location: UK
Posts: 261
splinter RepRank 0
Default

You'll need to do this:

Code:
.link1 {
color: #[colour];
}
.link1:hover {
color: #[colour];
}
etc. etc.
And you use the same HTML.
Reply With Quote
  #10 (permalink)  
Old 03-20-2004, 02:48 PM
WebProWorld Pro
 

Join Date: Jan 2004
Location: Empangeni, South Africa
Posts: 124
justinw RepRank 0
Default

Yeah... the second one works correctly! Thanks a lot!
__________________
Website designs in Empangeni, South Africa: www.jwdesigns.co.za
Reply With Quote
Reply

  WebProWorld > Site Design > Graphics & Design Discussion Forum
Tags: , ,



Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0