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

Heather Comer
Heather Comer
1,956 Points

When I type the inline style on the h1 tag, everything turns red starting with the closing quotation mark.

I have typed <h1 style="color: white;">Lake Tahoe, California</h1>

It is acting like the h1 element isn't closed and like style isn't recognized because "style" isn't a different color like it was when I typed the <body style="background...etc. element.

Can you post your whole code? I am wondering if there is something in the style section. In the online tutorial, he spends some time doing internal styling to compare how it interacts with inline styling which should over-ride it. Maybe when translating the examples, you've got something going on? From what I see you typed the same thing as what is in the course. So it would be helpful to see this in the larger context. Be sure to use the Markdown Cheatsheet to make your copy past of code show up as HTML.

3 Answers

you forgot to put " before color in style it should be something like this <h1 style="color: white;">Lake Tahoe, California</h1>

Heather Comer
Heather Comer
1,956 Points
<!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>
Heather Comer
Heather Comer
1,956 Points

I closed the workspace and reopened it and then retyped everything. This time, "style" is the right color, but it is still acting like the tag isn't closed.

Dave StSomeWhere
Dave StSomeWhere
19,870 Points

Yep the tag isn't closed - you're missing the opening quote on the h1 style