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

Why does my style.css not turn the background orange??

index.html reads "<html> <head> <title>Lake Tahoe</title> <link rel="stylesheet" href="css/style.css"> </head> <body> <header> <span>Journey through the Sierra Nevada Mountains</span> <h1>Lake Tahoe, California</h1> </header> <p> Lake Tahoe is one of the most breathtaking attractions located in California. It's home to a number of ski resorts, summer outdoor recreation, and tourist attractions. Snow and skiing are a significant part of the area's reputation. </p> <a href="#">Find out more</a> </body> </html>"

style.css reads " body { text-align: center; }

h1 { font-size:72px: color: white;
}

header { background-color: orange; }

p { font-size: 20px; }

4 Answers

Sorry for the lack of punctuation, it wouldn't punctuate on the post

Brendan Whiting
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 Points

I pasted your code into a codepen and it seems to work. Maybe you didn't have the css file in the directory at that path? Maybe you just didn't save?

PS here's a guide on posting code to the forum so it's more legible: https://teamtreehouse.com/community/posting-code-to-the-forum

Hey Brendan,

In index.html within the <head></head> element I put: <link rel="stylesheet" href="css/style.css">

Is that not the proper way to do it?

I confirmed that I did save. I had this issue earlier when my code seemed to match perfectly to that of the videos so possibly its a glitch within the workplace itself?

Brendan Whiting
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 Points

Yes that is the right way to do it. But does the file have exactly that name? And is it in a directory called css that’s in the same directory has your html file?

File matches the name directly and is within the css directory

I figured it out. The styles.css was saved as its on file, as opposed as being saved within the main folder. Once I dragged it into the main folder, it merged and worked perfectly. I do appreciate your help very much.