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.

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

The green header is not showing up in CSS the code is correctly written.

I am following along on the video and typed everything correctly as explained. However, the green header does not show up on my website. I suspect it has something to do with HTML. However, I am not sure what and where to find it, please help.

3 Answers

James Home
James Home
12,011 Points

Please remember to post the HTML and the CSS in your post using the Markdown syntax.

Thank you! Here is a copy of the code for CSS.

a {
  text-decoration: none;
}

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

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

a {
  color: #AA0078;
}

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

h1, h2 {
  color: #fff;
}

I could be wrong but does it just need to be 'background-color' rather than just 'background' ?

Thank you for the reply. I just checked the video and it says background. I am curious how does the background differ from background color?

James Home
James Home
12,011 Points

It is good practice to be specific so "background-color" is better than" background" but this website uses "background" when specifying the background color. I believe the difference is largely semantic.

Are you not overwriting it later, is this all of the CSS? Did you make sure you called it "header" in the html, rather than giving a div a class of header?

Colin Bell
Colin Bell
29,679 Points

From MDN: Background:

background:

The background CSS property is a shorthand for setting the individual background values in a single place in the style sheet. Background can be used to set the values for one or more of: background-clip, background-color, background- image, background-origin, background-position, background-repeat, background-size, and background-attachment. It can also be used to set multiple backgrounds.

background-color:

The background-color CSS property sets the background color of an element, either through a color value or the keyword transparent.

That is, the background-color only accepts one possible value - a color. It can be hex, rgb(a), hsl(a), or a color name.