Solved

CSS to control alink and vlink color

Posted on 2001-09-11
6
876 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jquery add something to a div 4 43
Centered Image 2 27
Change of column alignment in div 2 18
Make options hidden and show just option that is on 1 10
CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

786 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