No problem. Maybe if we take a step back and look at some of the underlying principles, that will help.
Imagine this: <p>Some interesting content</p>
If you want to change the style of this, you would do p{color:red};
This will target every p element in the whole document.
Now suppose we have three <p> elements and you just want to target the middle one. To do that you give it a class:
<p>Some interesting content</p>
<p class="special">Some more interesting content</p>
<p>Some even more interesting content</p>
p{color:red;} will change them all red
Then you would do .special{color:yellow;}
That will get the one in the middle with the class applied to it.
Now imagine this:
<p>Some interesting content</p>
<p class="special">Some more interesting content</p>
<p>Some even more interesting content</p>
<div class="special">Nothing special here</div>
If you use .special{color:yellow;} you will target the text in both the <div> and the <p>
If that’s not what you want to do, then you can get even more specific:
<p><a href="#">A link</a> Some interesting content</p>
<p class="special">Some more interesting content</p>
<p>Some even more interesting content</p>
<div class="special">Nothing special here</div>
What colour do you think the link will be?
That’s right, blue. It will inherit the default link colour, as there is currently no rule saying otherwise.
If we want to style it, we could of course go: a{color:gray} and that would hit all a tags in the document. Job done!
Now imagine this:
<p><a href="#">A link</a> Some interesting content</p>
<p class="special">Some more interesting content</p>
<p>Some even more interesting content</p>
<div class="special">Nothing special here</div>
<a href="#">Another link</a>
If we want to target only the link in the p tag, we could do p a{color:yellow};
Last example:
<p><a href="#">A link</a>Some interesting content</p>
<p class="special"><a href="#">Link three</a>Some more interesting content</p>
<p>Some even more interesting content</p>
<div class="special">Nothing special here</div>
<a href="#">Another link</a>
How can we target only the link in the <p> tag with the class of “special”? p.special a{color: cyan}
Hopefully you get the idea of drilling down to become more specific.
Here’s the whole example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Unbenanntes Dokument</title>
<style>
p{color:red;}
p.special{color:yellow;}
div.special{color:green;}
a{color:gray}
p.special a{color:cyan}
</style>
</head>
<body>
<p><a href="#">A link</a> Some interesting content</p>
<p class="special"><a href="#">Link three</a> Some more interesting content</p>
<p>Some even more interesting content</p>
<div class="special">Nothing special here</div>
<a href="#">Another link</a>
</body>
</html>
So, to answer your question, this is a commented version of your style sheet.
/* Targets all h1 tags */
h1{color:#ffffff; font-size: 19px; font-weight:bold;font-style:italic; text-align:center;}
/* Targets all h2 tags */
h2 {color:#cd0000; font-size: 15px; text-decoration:underline;font-weight:bold;}
/* Targets all p tags with a class of two */
p.two {color:#cd0000; font-size: 15px;font-weight:bold;}
/* Targets all unvisited anchor tags (as above) */
a:link {color:#cd0000;}
/* Targets all p tags with a class of three */
p.three {color:#000080; text-decoration:none;}
/* Targets all unvisited anchor tags (overwrites the previous rule) */
a:link {color:#000080;}
/* Targets all p tags with a class of four*/
p.four {color:#000000; font-size: 15px;font-weight:bold;}
/* Targets all unvisited anchor tags with a class of four */
a.four:link{color:#000000;}
If all of this doesn’t help you solve your problem, please just post a link to the page in question.
Tell me what you would like and how it is not working.
But don’t forget about the :visited rule as a:link only defines links that are not visited. You could just use p.four a{styles etc…} as that will style all states of the a element unless you have previously defined specific link and visited states in which case you would need to say.
Along the same lines as Pullo’s and Paul’s observations, please note that there are two (2) a:link rules in your d5dstyle.css sheet. The second rule, a:link {color:000080;} will override the first rule; therefore, the first rule will never be applied.
Also, there is an order in which anchors must be coded for the states to function that you may not be aware of:
a:link
a:visited
a:hover
a:active
Skipping or mixing the order of the pseudo-classes can have unexpected results. There’s plenty of documentation around that explains how to code and color anchors.
Finally, I looked at your censusentries.php page. You are correct when you said that the HTML on that page has no validation errors, BUT, that is misleading. The page that WE SEE also includes the menu.php include file and the HTML in the menu.php is incorrectly formed. ALL of the errors indicated by the validator are from the menu.php code. Most are duplicate id’s, BUT THE REST ARE STRAY TAGS. Those STRAY TAGS are the major cause of your menu problems; NOT THE CSS. I did not touch the CSS. I just matched the tags. Same thing I did with your previous page… cleaned up the tags in the include file. All the css in the world cannot make up for BROKEN HTML. Period.
Please look at the ENG & WALES menu items and see if the nested lists are working correctly.
You can copy and paste the corrected menu code to your menu.php file, BUT BE AWARE that I changed the duplicate id names to bogus names. You can find and correct them if they matter. They are easy to spot.
Just a ouple of final queries if I may. I have sorted the table but there is an anomaly.
When I use this CSS p.four a:link,p.four a:visited {color:#000000; font-size: 15px;font-weight:bold;} and this in the html <p class=“four”> the p send the links down a line.
Out of curiosity, how do you write your code? Do you use a text editor? If so, which one? Also, what browser and version do you use?
The menu.php code is a little mixed up again. Please copy and paste exactly this code into your menu.php file, including the space at the beginning of the first line and and the staircase of closing tags at the end.
Change the id name to something that begins with an alpha character. Most of your other ids being with “menu-item-”. Maybe that would work if it isn’t used elsewhere.