Solved

CSS to control alink and vlink color

Posted on 2001-09-11
6
866 Views
Last Modified: 2008-02-01
I'm trying to find out if it is possible to control active and visited link color with an EXTERAL style sheet. I can currently control the link color with an internal style sheet but to aid in controlling multiple pages, I would like to do it with an external style sheet. My link is embedded into a table and I can control all aspects of it with one style tag except for the link color.

-seamil
0
Comment
Question by:seamil
  • 3
  • 3
6 Comments
 
LVL 5

Expert Comment

by:raizon
ID: 6475174
Like this.

A:Visited{color: #ff00ff;}
A:Active{color: #ff0000;}
0
 

Author Comment

by:seamil
ID: 6475213
That works if I have the style sheet imbedded directly into my page. I want add the link color control into an external style sheet. I have enclosed the style tag that I'm using below. What I'm looking for is the appropriate syntex to make it complatable with an external style tag.

td.link      { background-color: #000099; color: #FFFFFF; font-family: Arial, Verdana, Tahoma; font-size: 10pt; font-weight: bold; (syntex for vlink and alink here) }

-seamil
0
 
LVL 5

Expert Comment

by:raizon
ID: 6475218
You can't apply the visited or active elements to the links there.  But what you could do is

A.link { background-color: #000099; color: #FFFFFF; font-family: Arial, Verdana, Tahoma; font-size:
10pt; font-weight: bold;}
A:Visited.link{color:#ff00ff;}
A:Active.link{color:#ff0000;}

Then call that class in your href as so.

<td><a href="mypage.htm" class="link">My Page</a></td>
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:seamil
ID: 6475261
I have them as three separate lines in my external style sheet and it works great with IE 5 but is not working with Ns 4.73. What can you suggest so this can work on both? Or should I just embed the color control style tags in side of my pages?

-seamil
0
 
LVL 5

Accepted Solution

by:
raizon earned 20 total points
ID: 6475510
Netscape 4.73 doesn't support the visited, active, and hover in style sheets.  I don't believe visitted and active are supported until 4.76 but I could be wrong about that.  Only IE4.+ and NS6 support the A:Hover.

0
 

Author Comment

by:seamil
ID: 6476661
Thanks raizon!
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now