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
Differentiate behavior for <a name> vs. <a href>
Old 02-28-2008, 11:56 AM Differentiate behavior for <a name> vs. <a href>
aschecht's Avatar
Extreme Talker

Posts: 190
Name: A
Location: San Jose, CA
Trades: 6
I've set up CSS formatting for links with the following code:

a:link {color: #00728B;}
a:visited {color: #7497A7;}
a:active {color: #00728B;}
a:hover {color: #00728B;}

I just noticed that text I have marked as a target with the <a name> tag does not have the "link" color applied but does change on hover. This is a bit distracting since it suggests to users that these are clickable links when they are not.

Here's an example.

Is there a way to differentiate the hover behavior so it applies to a href but not to a name?

Thanks,

Andrew
aschecht is offline
Reply With Quote
View Public Profile Visit aschecht's homepage!
 
 
Register now for full access!
Old 02-28-2008, 11:57 AM Re: Differentiate behavior for <a name> vs. <a href>
aschecht's Avatar
Extreme Talker

Posts: 190
Name: A
Location: San Jose, CA
Trades: 6
Addendum: I just noticed that this happens in Firefox but not in IE7. Hmmm?

A.
aschecht is offline
Reply With Quote
View Public Profile Visit aschecht's homepage!
 
Old 02-28-2008, 01:27 PM Re: Differentiate behavior for <a name> vs. <a href>
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
Not unless you do something like:
a.href:link {}
a.href:visited {}
a.href:hover {}
a.href:active {}
Then had all your <a href> with <a class="href" href>, also please note, hover needs to come before active. NEEDS to.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 02-28-2008, 02:21 PM Re: Differentiate behavior for <a name> vs. <a href>
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
You don't need the <a name... blah blah> - all you need to do is us an ID on the anchor --like this:

<h1 id="top"></h1>

Then to link to it it's the same: <a href="#top">go top</a>
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

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


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

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 02-28-2008, 03:01 PM Re: Differentiate behavior for <a name> vs. <a href>
aschecht's Avatar
Extreme Talker

Posts: 190
Name: A
Location: San Jose, CA
Trades: 6
Thanks for the input. These targets are throughout a 2800 page e-book with probably several thousand anchors. I'm not going to rename the anchors. I think Jerod's solution of adding a class to each href tag (but not the name tags) could be done easily with a search/replace. It seems a bit sloppy though (to need to add a class just to differentiate it from an anchor).

Any reason why hover needs to come before active? Just the standard or does it mess with function?

Andrew
aschecht is offline
Reply With Quote
View Public Profile Visit aschecht's homepage!
 
Old 02-28-2008, 03:10 PM Re: Differentiate behavior for <a name> vs. <a href>
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
Any reason why hover needs to come before active? Just the standard or does it mess with function?
That is the standard - link, visited, hover, active - in that order when using pseudo classes.

As for your css problem, I think you could fix it with specificity rather than adding a class, especially if your anchors are consistent throughout.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

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


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


Last edited by LadynRed; 02-28-2008 at 08:13 PM..
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 02-28-2008, 04:11 PM Re: Differentiate behavior for <a name> vs. <a href>
aschecht's Avatar
Extreme Talker

Posts: 190
Name: A
Location: San Jose, CA
Trades: 6
Quote:
Originally Posted by LadynRed View Post
fix it with specificity
I'm intrigued. What does this mean?

Andrew
aschecht is offline
Reply With Quote
View Public Profile Visit aschecht's homepage!
 
Reply     « Reply to Differentiate behavior for <a name> vs. <a href>
 

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.86920 seconds with 12 queries