• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

changing link color for just one part of a page

 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Read this:
http://xbiz.com/articles/print.php?article_idp=612
Eric
 
Frank Carver
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic