homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

Different link attributes possible on same page?
Can you have two unique linking attributes for separate font classes?

10+ Year Member

Msg#: 635 posted 10:05 pm on Feb 18, 2003 (gmt 0)

Excellent site! Great resource here for anyone working with CSS.

I'm not exactly new to CSS but beyond using style sheets as basic text guides for a couple of years, I have only recently begun to explore all the other advantages CSS gives to web designers.

I haven't seen this question asked yet, and after trying -- but failing -- to play around with what I thought were solutions, so am asking:

Is it possible to include on a style sheet more than one text-link attribute beyond the basic a:link, a:visited, etc.? I've tried including link/visited/etc. attributes with a specific font class but that seems to only result in the link color acting as a background color instead of the linked-font color.

My dilemma is this: I'm using the standard a:link attributes to control the color and behavior of my nav bar font. However, I don't want the same attributes to influence the color or behavior of another set of links on the same page(s).




WebmasterWorld Senior Member drdoc us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 635 posted 5:36 am on Feb 19, 2003 (gmt 0)

Welcome to Webmaster World!

Yes, it is very much possible, by defining classes :)

For example, let's say that you're using the regular a:link a:visited etc for the "normal" links on the page. Then, all you have to do is give your navigation links a separate class. For example:

<a href="#" class="nav">Navigation link</a>

In your style sheet:

a.nav:link {
color: #06c;
a.nav:visited {
color: #c60;

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved