Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

changing link color for just one part of a page

 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been banging my head over this for a few days, and I thought I'd ask the wizards in here.
I currently have a site style where chunks of text are often headed by a dark background bar with white text. The body of the page is mostly black text on a white or light grey background. This works fine until I want a link in the text on the bar. Then it ignores the white text color and uses the regular blue/purple, which looks horrible and illegible. I know how to set the link style color for the whole page, but so far I haven't found a way of setting it just for one part of the page.
Here's what I do at the moment (with excess junk removed):
site.css:

index.html:

Any suggestions what I can do in the style file to ensure that links in the dark header bars appear white like the regular text?
Many thanks.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read this:
http://xbiz.com/articles/print.php?article_idp=612
Eric
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Eric. That was interesting, but not quite what I wanted. In the end I found another tutorial which pointed out that you can limit style changes to an arbitrary hierarchy of elements using " " (space) as a separator. So I added

to my style file, and now all links (visited and unvisited) in an area of class "divider" appear as white. I knew there had to be a way.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic