/    Sign up×
Community /Pin to ProfileBookmark

link etiquette

[code]
a:link {color:#788282;text-decoration:none;}
a:visited {color:#788282;text-decoration:none;}
a:hover {color:#aaaaaa;text-decoration:none;}
a:active {color:#788282;text-decoration:none;}
a.headerlnk:link {color:#000000;text-decoration:none;}
a.headerlnk:visited {color:#000000;text-decoration:none;}
a.headerlnk:hover {color:#788282;text-decoration:none;}
a.headerlnk:active {color:#000000;text-decoration:none;}
[/code]

I want to keep the header links for my menu a a different color from the links in the body of the menu and the body of the page. I know I can apply a separate link color for a containing element, but each header link is in a different div and the div that contains them all will contain menu links too… I figured using a class would be the easiest way to do this. Apon searching this forum I found other ways to switch link color, I was wondering if doing it this way was good etiquette.

to post a comment
CSS

9 Comments(s)

Copy linkTweet thisAlerts:
@ray326Mar 10.2004 — The only "etiquette" issue I see *possibly* being raised by someone would be the disabling of the visited indication.
Copy linkTweet thisAlerts:
@Robert_WellockMar 10.2004 — That would therefore mean anyone who used an image navigation system would be tarred with the same brush.

Apart from the CSS bloat but that's probably due to M$ Explorer screwing up again (M$ IE doesn't support :hover for a elements, which haven't got href specified.)

I don't find anything wrong a?hover, and a:visited:hover as it's a fairly normal soloution.
Copy linkTweet thisAlerts:
@pyroMar 10.2004 — Perhaps easier, however, would be something like this:

<style type="text/css">
a { color: #900; }
a:hover { color: #f00; }
#nav a { color: #006; }
#nav a:hover { color: #00f; }
</style>


Using that, you don't have to add classes to all your links.
Copy linkTweet thisAlerts:
@Robert_WellockMar 10.2004 — Links? One demerit point, anchors is what you meant to say. ?
Copy linkTweet thisAlerts:
@pyroMar 10.2004 — Lol... I guess, if you want to get that technical about it. ?
Copy linkTweet thisAlerts:
@Robert_WellockMar 10.2004 — Yes, you know I was pulling your legs ?
Copy linkTweet thisAlerts:
@PeOfEoauthorMar 10.2004 — [i]Originally posted by pyro [/i]

[B]Perhaps easier, however, would be something like this:



<style type="text/css">
a { color: #900; }
a:hover { color: #f00; }
#nav a { color: #006; }
#nav a:hover { color: #00f; }
</style>


Using that, you don't have to add classes to all your links. [/B][/QUOTE]
well the problem is I would be making all of the links in the container that color too then, since I have a few links within these divs. I am assumeing css does inheritance so the links in this div and the div within the div would all be affected... it justs seems logical. It would be less code to put the header links in this class if the other ones have the body style instead of giving the main div a separate link color and then the div within another link color... thats why I though about giving the links a class. I was just wondering if this is a proper way to do things, thats all.
Copy linkTweet thisAlerts:
@JonaMar 12.2004 — [font=arial]Peo, if you have a div inside of the #nav div, you should be able to refer to its child links as #nav #childDiv a { ... }

I could be wrong, but I believe it will work.[/font]

[b][J]ona[/b]
Copy linkTweet thisAlerts:
@PeOfEoauthorMar 12.2004 — That would still be more work since I would have to specify the ones in the nav divs to be this color and the headers. I figured a class would be easier I would only have to specify it on the header links.
×

Success!

Help @PeOfEo spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...