Defining hyperlink link color in CSS

He has: 286 posts

Joined: Mar 2003

I'm trying to define the hyperlink color as white in one of my tables, called "content".

Here is the code I've been working with:

#content
{
width: 15%;
margin-right: 85%;
font-family: Arial, sans-serif;
font-size: 100%;
font-weight: bold;
background: #000066;
}

I've tried adding lines like this:

#content a:link {
color: #FFFFFF;
}

However, I'm either placing them in the wrong order or using the wrong brackets. The links need to show up as white on a dark blue background (#000066).

Many thanks in advance,

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

That code works for me, Roy.

He has: 286 posts

Joined: Mar 2003

That code works for me, Roy.

Maybe it's the way I'm placing it.

Here is the full style:

#content {
a: link color: #FFFFFF;
width: 15%;
margin-right: 85%;
font-family: Arial, sans-serif;
font-size: 100%;
font-weight: bold;
background: #000066;
}
#sidebar {
position: absolute;
top: 0;
right: 0;
font-family: Arial, sans-serif;
font-size: 75%;
width: 85%;
}

I want the fonts to be white (#FFFFFF), but instead the entire "content" column turns white.

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Well that example isn't right! Now you've got the link call inside the #content bit. It should be as you had it in your first message:

#content
{
width: 15%;
margin-right: 85%;
font-family: Arial, sans-serif;
font-size: 100%;
font-weight: bold;
background: #000066;
}

#content a:link {
color: #FFFFFF;
}
' The other link classes should go in order: link, visited, hover, active (think love/hate)

He has: 286 posts

Joined: Mar 2003

Yes, that does it!

Thank you, Megan.

......Roy

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.