Hello, I am working on a school project for my web development class. My project is complete other than one lingering issue. I can’t get visited links in my menus to change colors after they have been clicked on. Here is my current CSS (I added all of the #nav_list items, my teacher provided the rest of the code):
html {
background-image: url(“…/images/bats.gif”);
}
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
width: 800px;
background-color: white;
margin: 0 auto;
padding: 0;
border: 3px solid black;
box-shadow: 0 9px 18px 9px;
}
h1, h2, h3, p {
margin: 0;
padding: 0;
}
a {
font-weight: bold;
color: orange;
}
a:link, a:visited {
color: orange;
}
a:hover, a:focus {
color: green;
}
/* Header */
header {
background-image: -webkit-linear-gradient(45deg, white 0%, orange 75%, black 100%);
background-image: -moz-linear-gradient(45deg, white 0%, orange 75%, black 100%);
background-image: -o-linear-gradient(45deg, white 0%, orange 75%, black 100%);
background-image: linear-gradient(45deg, white 0%, orange 75%, black 100%);
padding: 15px;
border-bottom: 2px solid black;
}
header img {
float: left;
padding-right: 15px;
}
header h2 {
font-size: 230%;
}
header h3 {
font-size: 125%;
}
/* Sidebar */
aside {
float: left;
width: 160px;
padding: 20px 0;
}
aside ul {
line-height: 1.5;
}
/* Section */
section {
width: 580px;
float: right;
padding: 20px 40px 20px 20px;
}
section h1 {
font-size: 140%;
margin-bottom: .5em;
}
section h1:first-letter {
font-size: 240%;
}
section h2 {
font-size: 125%;
margin: .8em 0 .5em 0;
}
section h3 {
font-size: 110%;
margin: .8em 0 .5em 0;
}
section p {
margin-bottom: .5em;
}
/* Footer */
footer {
clear: both;
border-top: 2px solid black;
padding: 15px;
background-image: -webkit-linear-gradient(45deg, black 0%, orange 25%, white 100%);
background-image: -moz-linear-gradient(45deg, black 0%, orange 25%, white 100%);
background-image: -o-linear-gradient(45deg, black 0%, orange 25%, white 100%);
background-image: linear-gradient(45deg, black 0%, orange 25%, white 100%);
}
footer p {
font-size: 90%;
text-align: center;
}
/* menus */
- { margin: 0;
padding: 0; }
#nav_list ul li a {
display: block;
padding: .5em 0 .5em .5em;
color: red;
font-weight: bold;
}
#nav_list ul li a:link {
color: red;
text-decoration: none;
}
#nav_list ul li a:visited {
color: green !important;
}
#nav_list ul li a:hover, a:focus {
color: white; }
#nav_list ul {
list-style-type: none;
margin-bottom: 1.5em; }
#nav_list ul li {
width: 150px;
margin-bottom: -4px;
background-color: yellow;
border-width: 4px;
border-color: black;
border-style: solid;
position: relative;
padding: 0;
}
#nav_list ul li:hover {
background-color: orange;
}
#nav_list ul li:last-child {
margin-bottom: 0; }
#nav_list ul ul {
display: none;
position: absolute;
top: -4px;
left: 100%;
margin-left: 0; }
#nav_list ul li:hover > ul {
display: block; }
#nav_list > ul::after {
content: “”;
display: block;
clear: both; }