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 trialSean Smith
Courses Plus Student 2,353 PointsBackground Header disappears when I add background-size or background-repeat.
Using atom as text editor. Added background image, image shows up no problem. When background-size or background-repeat are added, image disappears. Image reappears when background-size and background-repeat are commented out.
.main-header { background-color: #ffa949; padding-top: 170px; height: 850px; background-image: url(../img/mountains.jpg) /* background-size: 40% background-repeat:no-repeat; */ }
2 Answers
Steven Parker
231,275 PointsI notice the semicolons that should separate the "background-image", "background-size" and "background-repeat" properties are missing. That most likely causes the entire rule be ignored.
Victor Rebello
2,322 PointsAgree with Steven. Also you missed the inverted commas inside the parenthesis. Try using the inverted commas. Good Practice. Happy coding ! :D
Steven Parker
231,275 PointsFYI: quotes ("inverted commas") are optional in url() notation.