Ezilon.com - Target Your Audience, be Seen in Your Region

Defining hyperlink link color in CSS

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

He has: 257 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
Administrator

She has: 10,126 posts

Joined: Jun 1999

That code works for me, Roy.

He has: 257 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
Administrator

She has: 10,126 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: 257 posts

Joined: Mar 2003

Yes, that does it!

Thank you, Megan.

......Roy