Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML How to Make a Website Customizing Colors and Fonts Write Hexadecimal Colors

pamela guy
PLUS
pamela guy
Courses Plus Student 4,311 Points

if my text is white and i want to hover over the text and make it blue how would i do that?

In this case it is in a nav: nav a nav a:hover{ color: #fff color: #678987 }

not working to i have to put a:visited or a:selected?

css/main.css
a {
  text-decoration: none;
}

#wrapper {
  max-width: 940px;
  margin: 0 auto;
}

#logo {
  text-align: center;
  margin: 0;
}
h1, h2 {
  color: #fff;
}

p {
 color: #000000; 
}
nav a nav a:hover a:visited{
  color: #fff;
  color: #32673f;
}
Bartlomiej Figatowski
Bartlomiej Figatowski
5,843 Points

logo h1:hover{

color: #678987;

} or logo h2:hover{

color: #678987; }

It should work.

2 Answers

Steven Parker
Steven Parker
221,323 Points

Your CSS selector is invalid.

Try this simpler one instead:

nav a:hover {
  color: blue;
}

Just to be clear: this will not affect any text other than links ("a" elements) that are inside a nav element. If you want this to apply to other text, you'll need an appropriate selector for that text. For example, if you wanted to make any paragraph turn blue when you hover on it:

p:hover {
  color: blue;
}
Hadi Khalili
Hadi Khalili
7,969 Points

You need to use two rules to accomplish what you want to do. Here is how: first rule declares the color of nav a text when nothing is happening.

nav a {
  color: #fff;
}

Then the hover color

nav a:hover{
  color: blue;
}

Note: if you want to use one rule for hover and visited because they share the same color, you need to use comma to separate selectors. Comma is not need when you want to select an element nested inside the parent element.

nav a:hover, nav a:visited {
  color: blue;
} 

Good Luck