Forum Moderators: not2easy
Below is my attempt - but the 'hover' and 'visited' colours come out the same for 'menu1'.
body { color: #000000; background: #FFFFFF; }
strong { color: #000066 }
h1 { font-size: 120%; color: #000099; margin-bottom: 0em;}
h2 { font-size: 100%; color: #000099; margin-bottom: 0em;}
h3 { font-size: 100%; color: #000099; margin-bottom: 0em;}
p {margin-top:0em}
body { font-family: Arial, Helvetica, sans-serif; }
h1,h2 { font-family: Arial, Helvetica, sans-serif; }
h3 { font-family: Times New Roman, Times, serif; }
PRE, TT, CODE, KBD, SAMP { font-family: monospace }
:link { color:#000099 } /* for unvisited links */
:visited { color:#000099 } /* for visited links */
:active { color:#000099 } /* when link is clicked */
:hover { color:#FF0000 } /* when mouse is over link */
a.menu1 {font-family:Arial, Helvetica, sans-serif; font-size:12pt; font-style:normal; font-weight:bold; text-decoration:none; color:#FFFFFF;}
a.menu1:hover { color:#FFFF00; text-decoration:underline }
a.menu1:visited { color:#FFFFFF; text-decoration:underline }
One trick that I find helps me out of these sticky corners is to ensure I'm applying the class to the anchor tag and not it's parent, i.e.:
Instead of:
<td class="menu1"><a href="#">test</a></td>
Try:
<td><a href="#" class="menu1">test</a></td>
Additionally I always specify my selector before the pseudo class:
:link -> a:link though I didn't have any problems with your stylesheet in IE5.5
The CSS is working as expected with every browser I can throw at it (IE5.5, NN6.1, Opera 5.12, NN4.7) - Unfortunately I haven't got IE5.0 installed so I can't really attack this problem for you :( Sorry.
Perhaps someone using IE5 fancies the challenge?
Have you tried validating the HTML/CSS to see what that throws up - this might lead you to the problem.
Sorry again.
(when will we be able to install multiple versions of IE do you reckon ;))
This goes in the <body>
<div id="menu1">
Your menu html goes here
</div>
Then in your style sheet assign the rules to the id of menu1
like this
#menu1 A:hover{color:blue}
#menu1 A:hover{visited:red}
HERE IS SOME OF THE FAULTY MENU HTML
<p CLASS=menu1>
<a href="travel_destinations.htm">Destinations</a> ¦
<a href="city_travel_information.htm">City Travel Information</a>
<a href="otherservices.html"></a> ¦
<a href="hotels_travel_services.htm">Other Services</a>
</p>
HERE IS MY .CSS FILE
body { color: #000000; background: #FFFFFF; }
strong { color: #000066 }
h1 { font-size: 120%; color: #000099; margin-bottom: 0em;}
h2 { font-size: 100%; color: #000099; margin-bottom: 0em;}
h3 { font-size: 100%; color: #000099; margin-bottom: 0em;}
p { font-family: Arial, Helvetica, sans-serif; margin-top:0em;}
body { font-family: Arial, Helvetica, sans-serif; }
h1,h2 { font-family: Arial, Helvetica, sans-serif; }
h3 { font-family: Times New Roman, Times, serif; }
PRE, TT, CODE, KBD, SAMP { font-family: monospace }
:link { color:#000099 }
:visited { color:#000099 }
:active { color:#000099 }
:hover { color:#FF0000 }
.menu1 {font-size:12pt; font-weight:bold; text-decoration:none; color:#FFFFFF; link:#FFFFFF;}
#menu1 A:hover{color:#FF0000}
#menu1 A:hover{visited:#FFFFFF}
joshie76
- Your not whining, I need all the help I can get.
- Have added A:link { color:#000099 } etc
- And a class attribute to the first anchor tag
David
- I'm not sure if I've understood you but have renamed items like so:
HERE IS SOME OF THE REVISED FAULTY MENU HTML
<p id="menu1" class="menu1a">
<a href="travel_destinations.htm" CLASS=menu1>Destinations</a> ¦
<a href="city_travel_information.htm">City Travel Information</a>
<a href="otherservices.html"></a> ¦
<a href="hotels_travel_services.htm">Other Services</a>
</p>
HERE IS MY REVISED .CSS FILE
body { color: #000000; background: #FFFFFF; }
strong { color: #000066 }
h1 { font-size: 120%; color: #000099; margin-bottom: 0em;}
h2 { font-size: 100%; color: #000099; margin-bottom: 0em;}
h3 { font-size: 100%; color: #000099; margin-bottom: 0em;}
p { font-family: Arial, Helvetica, sans-serif; margin-top:0em;}
body { font-family: Arial, Helvetica, sans-serif; }
h1,h2 { font-family: Arial, Helvetica, sans-serif; }
h3 { font-family: Times New Roman, Times, serif; }
PRE, TT, CODE, KBD, SAMP { font-family: monospace }
A:link { color:#000099 }
A:visited { color:#000099 }
A:active { color:#000099 }
A:hover { color:#FF0000 }
.menu1 {font-size:12pt; font-weight:bold; text-decoration:none; color:#FFFFFF; link:#FFFFFF;}
#menu1a :hover{color:#FFFF00}
#menu1a :visited{color:#FFFFFF}
<p id="menu1" class="menu1a">
<a href="travel_destinations.htm" CLASS=menu1>Destinations</a> ¦
<a href="city_travel_information.htm">City Travel Information</a>
<a href="otherservices.html"></a> ¦
<a href="hotels_travel_services.htm">Other Services</a>
</p>
</body>
Here is what finally worked:
It seems to have something to do with defining the font stuff again in the Link, Hover and Visited bits. Like so:
body { color: #000000; background: #FFFFFF; }
strong { color: #000066 }
h1 { font-size: 120%; color: #000099; margin-bottom: 0em;}
h2 { font-size: 100%; color: #000099; margin-bottom: 0em;}
h3 { font-size: 100%; color: #000099; margin-bottom: 0em;}
p { font-family: Arial, Helvetica, sans-serif; margin-top:0em;}
body { font-family: Arial, Helvetica, sans-serif; }
h1,h2 { font-family: Arial, Helvetica, sans-serif; }
h3 { font-family: Times New Roman, Times, serif; }
PRE, TT, CODE, KBD, SAMP { font-family: monospace }
A:link { color:#000099 }
A:visited { color:#000099 }
A:active { color:#000099 }
A:hover { color:#FF0000 }
.menu1 {font-size:12pt; font-weight:bold; text-decoration:none; color:#FFFFFF; }
A.menu1:visited { color:#FFFFFF; font-weight:bold; text-decoration:none }
A.menu1:link { color:#FFFFFF; font-weight:bold; text-decoration:none }
A.menu1:hover { color:#FFFF00; font-weight:bold; text-decoration:underline }