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 CSS Basics (2014) Getting Started with CSS Inline and Internal Styles

Josh Calkins
Josh Calkins
3,623 Points

I'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
Jeff Jacobson-Swartfager
15,419 Points

You 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
Jeff Jacobson-Swartfager
15,419 Points

So, 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
Jeff Jacobson-Swartfager
15,419 Points

Make 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
Josh Calkins
3,623 Points

Thank 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
Josh Calkins
3,623 Points

Awesome! 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
Josh Calkins
3,623 Points

Excellent will do! Thank you again