|
|
|
Junior Member
      
Group: Forum Members
Last Login: 10/10/2008 8:25:46 AM
Posts: 10,
Visits: 29
|
|
I have a CSS newbie question about formatting hyperlinks. In the video on this site: "Manually Controlling Your Styles", we learned how to add text styling to individual paragraphs. The example CSS code was:
#layer1 {
padding: 20px;
position: relative;
width: 400px;
z-index: 1;
background-color: #CCCCCC;
}
#layer1 p {
font-family: "Lucida Sans", Trebuchet MS", sans-serif;
font-size: small;
}
In the video: "Using CSS to style your links", we learned that we can apply that same method to control the different states of our hyperlinks in different parts of the website. So, I want to apply a different color scheme for hyperlinks in a div called #navLeft on my site. Following the example above, I tried to this – my bad/wrong code is posted below . What's the right way to code this so that I can set colors for the link, visited, hover & active states of hyperlinks inside the #navLeft div? THANK YOU!!!
#navLeft {
font-family: Arial, Helvetica, sans-serif;
font-size: small;
font-weight: bold;
color: #FFFFFF;
line-height: 32px;
margin-left: 12px;
}
#navLeft a:link {
color: #FFFFFF;
text-decoration: none;
}
a:visited {
color: #FFFFFF;
text-decoration: none;
}
a:hover {
color: #FFCC66;
text-decoration: none;
}
a:active {
color: #FFCC66;
text-decoration: none;
}
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 10/10/2008 8:25:46 AM
Posts: 10,
Visits: 29
|
|
I figured it out! If anyone's interested, here's an example of code that worked to create rollover effects for the left-hand navigation, different from the hyperlinks on the rest of the page.
#navLeft {
font-family: Arial, Helvetica, sans-serif;
font-size: small;
font-weight: bold;
color: #FFFFFF;
line-height: 32px;
width: inherit;
text-align: left;
}
#navLeft a:link {
color: #FFFFFF;
text-decoration: none;
}
#navLeft a:visited {
color: #FFFFFF;
text-decoration: none;
}
#navLeft a:hover {
color: #FFCC66;
text-decoration: none;
}
#navLeft a:active {
color: #FFCC66;
text-decoration: none;
}
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 12/28/2008 9:04:44 PM
Posts: 2,
Visits: 7
|
|
Thank you! I had the same question and now I have the answer.
|
|
|
|