473,225 Members | 1,418 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,225 software developers and data experts.

My "sub links" won't colour

Hi all,

I have started with css some months ago, and though I'm feeling more and more safe and comfortable, some parts of css still don't make perfect sense to me.

Right now I have this problem: I have a large column div with text and links in it, and then some "special area links" that should be orange and different from the standard text links.

But even though I have declared all colourchanges for my "special area" a tags, they just will not listen -- until I drag them outside my column div.

Here's a link to illustrate.

Hope someone can shed some light on this for me.

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  4.     <head>
  5.         <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
  6.         <title>Test Page</title>
  7.         <style type="text/css" media="screen">
  8.             <!--
  9.             body { color: #acacac; font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 18px; background-color: #fce2ba; }
  10.             #textcolumn { background-color: #3c0000; padding: 10px; }
  11.             #textcolumn a { color: #acacac; }
  12.             #textcolumn a:link, #textcolumn a:visited   { color: #acacac; text-decoration: none; border-bottom: 1px dotted  }
  13.             #textcolumn a:focus, #textcolumn a:hover   { color: #fff; border-bottom: 1px solid  }
  14.             .subarea a { color: #f89828; font-size: 10px; }
  15.             .subarea a:link, .subarea a:visited { color: #f89828; }
  16.             .subarea a:focus, .subarea a:hover { color: #fff; }
  17.             -->
  18.         </style>
  19.     </head>
  21.     <body>
  23.         <div id="textcolumn">
  24.             Textcolumn text blah blah blah. <br />
  25.             <a href="#">Textcolumn link here</a>
  26.             <div class="subarea">
  27.                 <a href="#">Subarea link here</a>
  28.             </div>
  29.         </div>
  30.         <div class="subarea">
  31.             <a href="#">Subarea link here</a>
  32.         </div>
  34.     </body>
Aug 26 '07 #1
2 3544
7,435 Expert 4TB
I believe you are running into a 'specificity' issue. No time to explain but you might google for "css specificity".
Aug 26 '07 #2
You nailed it - brilliant. Never heard of that before, but I sure see now why some of my css seemed to have an attitude.

Expand|Select|Wrap|Line Numbers
  1. .subarea a { color: #f89828; font-size: 10px; }
Expand|Select|Wrap|Line Numbers
  1. #textcolumn .subarea a { color: #f89828; font-size: 10px; }
and everything works fine.

Thanks a lot for your help..! :D

Aug 27 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

by: pom | last post by:
What dynamnic open-source content management system(s) would you look at to meet the following specific situation? - The requirement is for a large institutional client who wishes to build a...
by: Konrad Mathieu | last post by:
Does this work in most browsers, namely MSIE? document.links.href or does it have to be document.links.href ?
by: Will Hartung | last post by:
I have this: <a class="pink_link" href="faq.html#q1">Go to question 1</a> And the CSS is simply: ..pink_link {color: #fa61b7; font-weight: bold;} So, I'm curious why my links are blue and...
by: Tee | last post by:
what's the differences between "Overrides Sub OnError" and "Sub Page_Error" ?
by: Danial Juka | last post by:
Hi All, I am making a content management system in asp.net. I want to show max 5 related links to other articles that somehow relate to the current article. An example of what I am looking...
by: loga123 | last post by:
Hi All, I am new to .net. I am creating a text box in a "button1" "click event" dynamically based on user input. Name of the text box and ID of the text box contro are set dynamically in the...
by: letsgetsilly | last post by:
I would like to know how sites can have "additional links" listed underneath their homepage in google. When you search google for "Bank of America " you can see they have a "Contact Us" page, a...
by: AutumnsDecay | last post by:
Hey there. I'm doing a website for a someone and I want to try something I've never tried before. However, I'm getting some trouble. With Javascript, I'm able to dynamically make text appear...
by: eBob.com | last post by:
How does a "sub-form", i.e. one invoked by another form, determine anything about the form which brought it into existence, i.e., I suppose, instantiated it? I wanted to so something like this ......
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.