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 trialshaneantabor
306 PointsThe 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
12,011 PointsPlease remember to post the HTML and the CSS in your post using the Markdown syntax.
shaneantabor
306 PointsThank 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;
}
Luke Nokes
5,290 PointsI could be wrong but does it just need to be 'background-color' rather than just 'background' ?
shaneantabor
306 PointsThank 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
12,011 PointsIt 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
29,679 PointsFrom 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.