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 trialJosh Calkins
3,623 PointsI'm typing in the <body style=“background-color:orange;”> and I'm still getting a white background when I hit preview??
I'm following along with the video practicing Inline Styling, and even though my code matches up perfectly it's not rendering properly when I hit preview. These are the lines I'm writing: <body style=“background-color:orange;”> and <h1 style=“color:white;”>Lake Tahoe, California</h1> and yet everything displays as standard HTML with a white background and black text. Can someone tell me where I'm going wrong?
6 Answers
Jeff Jacobson-Swartfager
15,419 PointsYou could have gotten the curly quotes from any of several sources a browser setting, copy and pasting from a word processor instead of a text editor, etc. Keep your eyes out for it. Once you can identify when it is happening, you'll have a good lead on what to do to prevent it in the future.
Jeff Jacobson-Swartfager
15,419 PointsSo, the issue was your quote marks.
The marks around your style values for both the h1
and the body
are curly quotes (“
& ”
). You need to use the double prime marks instead ("
).
That switch will make everything appear as expected, as you can see in this codepen.
Here's the code:
<!DOCTYPE html>
<html>
<head>
<title>Lake Tahoe</title>
</head>
<body style="background-color:orange;">
<header>
<span>Journey through the Sierra Nevada Mountains</span>
<h1 style="color:white;">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>
Jeff Jacobson-Swartfager
15,419 PointsMake sure to save your work before hitting preview.
If that doesn't resolve your issue, please post your code and we'll take a look.
Josh Calkins
3,623 PointsThank you! Here's the code, I had tried a saving a few different changes to see if it helped but no dice.
<!DOCTYPE html> <html> <head> <title>Lake Tahoe</title> </head> <body style=“background-color:orange;”> <header> <span>Journey through the Sierra Nevada Mountains</span> <h1 style=“color:white;”>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>
Josh Calkins
3,623 PointsAwesome! Thank you so much! This may sound like an even more ridiculous question than the first, but how did I even end up with curly quotes in the first place? I typed shift + (") the second time when fixing my code and it gave me prime quotation marks
Josh Calkins
3,623 PointsExcellent will do! Thank you again