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

The inline styles are not working

The inline styles are not showing for body and h1 tags when I hit preview. Here's my 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>

I don't see the body tag in your code. But the inline-style for the h1 one is working. As it is white and the background is also white u want see anything. Can you add the inline tag for the body element as well?

Hmm that's strange, I did copy all of it from Workspace here's the code again:

<!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>

Well really strange it disappeared. Try only the body tag maybe that works

formatted code. Select edit to review my changes and read the markdown Cheatsheet linked below.

2 Answers

try clearing your cache on the browser.

^This also works.

Thanks Ted, cleared cache and is working correctly now.

When there is an answer that solves your problem, please mark Best Answer. Also continue to upvote other good answers.

The inline style for the h1 looks fine but I don't see any for your body tag. Sometimes there are errors in the workspace itself. Have you tried saving it and reopening the workspace?

Saw Ted's edits: It looks like you answered the question correctly.

The other thing I could think of is that you probably don't need the ; at the end of your lines of code since it's just one value for each. This might be a small preferential choice but sometimes the workspace can be very specific