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 trialBryan Flanigan
2,617 PointsI'm having trouble getting my background color to change to orange when implemementing the CSS main.css code
My background color is not changing when I add the CSS.main to my html file. I have checked my syntax in my html and css.main file and they are correct. Was anyone else having a problem getting theirs to work?
Thanks.
Bryan
Yongshuo Wang
5,500 PointsWhat is the CSS file's name you have ? CSS file should be something like main.css instead of CSS.main.
Hope this can help you.
Bryan Flanigan
2,617 PointsIN my HTML file:
<head> <meta charset="utf-8"> <title>Bryan Flanigan | Designer</title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/main.css"> </head>
In my main.css file:
body { background-color: orange; }
Kody Kendall
2,473 PointsHi Bryan. This could be because you already have a background changing style element in your HTML file. Since it is a cascading document, having this background element after your "main.css" syntax would override any changes that are in the "main.css" file. Double check to make sure you don't have any background-color styling in your HTML that comes after your link to main.css
4 Answers
Jennifer Nordell
Treehouse TeacherWell, here you've listed the files as having two different file names. First you say "CSS.main" and then "css.main". Note that file names in links are case-sensitive. But that being said, css files should end in ".css". Your file name should be main.css... not css.main.
Konrad Pilch
2,435 PointsYep :D
Jennifer Nordell
Treehouse TeacherAre you absolutely positive that your file structure is set up correctly? Because you've listed three separate file names here for the CSS sheet. Make sure over in your file structure that "main.css" is actually named "main.css" and not "MAIN.css" or "css.main" or anything else. Also make sure that your css folder is named "css" and not "CSS" or "Css". Capitalization matters. I say this because so far your code looks fine. Also, make sure you save the file and refresh the page.
Bryan Flanigan
2,617 PointsJennifer you're awesome. My main CSS file folder was capitalized. I switched it to lower case and it worked perfectly. I needed a fresh set of eyes. Thanks to everyone for their help. I'm new at this and am still getting the syntax down it appears. Thanks again.
Jennifer Nordell
Treehouse TeacherAn extra set of eyes are always a great thing! We all need them occasionally :)
Olga Mendenhall
8,809 PointsBryan, I've just got the same problem! :D)) Thanks for raising that question! Thank you, so much Jennifer!!! :)*
Jennifer Nordell
Treehouse TeacherYou're quite welcome Olga G. Mendenhall :)
Konrad Pilch
2,435 PointsKonrad Pilch
2,435 PointsWell, theres probably an error in your syntax. Can you paste your code please? We can't help you most of the times without seeing the code, as usually its the code.