Link styles

liunx

Guest
I'm missing something here. Trying to style the text color for links inside a div with a class identifier. I don't care if I use an inline style or external, but I'd prefer to add the necessary coding to my existing external style sheet.

Basically, I have a 3-column layout. The right-side div is for text links. What I want is to color those links the same as the background color of the main div. Problem is, I need to make those changes within that div only.

Here's the styling for the div as it is in the external style sheet:

div.nav {
top:122px;
width:122px;
position:absolute;
left:10px;
height:100%;
border:0px solid red;
background:#990000;
margin-bottom:10px;
text-align:center;
}

I just can't figure out how to add the styling for a:link, etc. Nothing I've tried works.

TIAIt's a piece of cake :)

div.nav a {
/* Styles common to all states of <a> tag */
}

div.nav a:link {
/* Styles common to unvisited, unfocused, and unhovered <a> tags */
}

You get the feel for it? The space between "div.nav" and "a" is called the descendant selector. It simply says: If an <a> tag is contained in <div class="nav">, apply the following style rules.Thanks for the quick reply. That did it. I've looked around for a decent explanation of how to do that, but couldn't find anything that said "Put this here..." Actually, you didn't either;), but you got close enough for me to figure it out. Thanks again.You're most welcome.Here's some good info on CSS2 Selectors (<!-- m --><a class="postlink" href="http://www.w3.org/TR/REC-CSS2/selector.html">http://www.w3.org/TR/REC-CSS2/selector.html</a><!-- m -->). ;)And what about if someone (like me :) ) wouldn't want to format his links?
I just want them to appear as they are. Just the mouse pointer would change.

My page is full of tables, and the cells' classes define the text style. I want the links to look like as it was definied in the very td style.Sounds like a job for javascript...oh no...
please tell me it's not...No, it's not...But that does make a good lead-in for a scripting superhero!
 
Back
Top