Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS How to Make a Website Customizing Colors and Fonts Use Color in CSS

Vrund Patel
Vrund Patel
11,994 Points

I am unable to get colors and my text align in center.

I have the same file as Nick but not getting the same result.

Could you add your code in a code block? :) It'd help a ton with finding an answer! Use the Markdown Cheatsheet (link located below the text field you're typing in) for a quick lesson on how to do that!

Vrund Patel
Vrund Patel
11,994 Points
a {
  text-decoration: none;
}

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

#logo {
  text-align: center;
  margin: 0;
}

a {
  color: #6ab47b;
}

header {
  background: #6ab47b;
  border-color: #599a68;
}

h1, h2 {
  color: #fff;
}

nav {
  background: #599a68;
}

nav a, nav a:visited {
  color: #fff;
}

nav a.selected nav a:hover {
  color: #32673f;  
}

I got the color, but now i cannot get it in the center and also the hover does not work.

3 Answers

Seth McCombs
Seth McCombs
16,767 Points

Hey there Vrund Patel!

In your rule for the selected and hover, it appears you're missing a comma after "selected"

nav a.selected, nav a:hover { color: #32673f;
}

This should fix your hover state color!

Hi vrund,

There is supposed to be 2 selectors here separated with a comma. nav a.selected nav a:hover

Should be nav a.selected, nav a:hover

Is it the headings in your logo that are not being centered? If so, post the header section of your html.

Also, I fixed your code formatting. You want to use the backtick which is usually located above the tab key on the keyboard instead of the single quote.