Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LINK & VLINK

Status
Not open for further replies.

OhioSteve

MIS
Mar 12, 2002
1,352
US
I want ALL hyperlinks on my page be light blue. Consequently, I want to manually set the color of hyperlinks on my page. To achieve this, I used LINK & VLINK:

<body bgcolor="#CCFFFF" link="blue" vlink="blue">

There are two problems with my solution:

1) The tags are deprecated.
2) The vlink tag effects MOST of the visited hyperlinks but not the very last hyperlink visited. The very last visited hyperlink is still purple.

Please help me! :)
 
hello

first off it might be a better idea to use your styles in a stylesheet (.css file). delete what you have in your <body>tag, and put this in btwn the <head> tags of your html

<link rel="stylesheet" type="text/css" href="style.css">

then create a file called style.css

and put this in there


a:link {
color:#99CCFF;
}

a:visited {
color:#99CCFF;
}
a:hover {
color:#99CCFF;
}
a:active{
color:#99CCFF;
}

and that should make sure that your link doesnt change colour. i've used #99CCFF because its a light blue, you might want to start using hex numbers for colours instead of words to be more W3C compliant. a list of colours and their hex#'s can be found here:


hope that gets you a start

frainbreeze
 
You can use css to change any number of attributes about your anchors. Here's an example:
Code:
<style>
a {color:#ff0000; background-color:#000000; font-weight:bold}
</style>
<body>
<form name=blahForm>
<a href='[URL unfurl="true"]http://www.google.com'>Go[/URL] to Google</a>
</form>
</body>

-kaht

banghead.gif
 
you might want to start using hex numbers for colours instead of words to be more W3C compliant

That's a very misleading statement, given that there are 17 colour keywords that the W3C list as acceptable:

aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, orange, purple, red, silver, teal, white, and yellow

The list of the RGB values for these colours can be found here:


Hope this helps,
Dan
 
alright, my bad about the w3c comment

the point about hex value over colorname still stands though, it'd be better to get into the habit of coding colours in hex and not by the actual name of the colour - as it broadens the spectrum of possible colours you can use. also using a hex value to identify a color is that its easy to specify a web-safe or non-dithering color, so that what you intended it to appear as actually does so.

frainbreeze
 
I don't have the administrative authority to impose a style on the entire web. However, I did try to put a css in the web page's header. Then I tried to use it in a <div> on the page.

This was my attempt~

<html>
<head>
<style type="text/css">
div.myOutput
{
a:link
{
color:#99CCFF;
}

a:visited
{
color:#99CCFF;
}
a:hover
{
color:#99CCFF;
}
a:active
{
color:#99CCFF;
}
}
</style>
</head>
<body bgcolor="#CCFFFF">
<div class="myOutput">
[many lines of html and .asp code]
</div>
</body>
</html>

The page loaded, but the hyperlinks still had the default colors :(. I sense that I am close to a solution. Do you have any suggestions?
 
Your code:
Code:
<style type="text/css">
div.myOutput
{
  a:link
  {
     color:#99CCFF;
  }
  a:visited
  {
    color:#99CCFF;
  }
}
</style>
You're trying to nest elements' css inside each other: try this
Code:
<style type="text/css">
div.myOutput a:link
  { color:#99CCFF; }
div.myOutput a:visited
  { color:#99CCFF; }
</style>

or this way:

<style type="text/css">
div.myOutput a:link, div.myOutput a:visited 
  { color: #9cf; }
</style>

If it's all the links on the page you want to change, you don't need the div...
Code:
<style type="text/css">
  a:link, a:visited {color: #9cf;}
</style>

<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top