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

HTML How to Make a Website Beginning HTML and CSS Write a CSS Selector and Property

I followed the example exactly. Why am I getting "Bummer! Don't forget your style tag" message?

This is what I have:

<style>

h1 { color: blue; } </style>

<h1>Something Else</h1>

Where am I going wrong?

Ethan Lowry
Ethan Lowry
Courses Plus Student 7,323 Points

( If you want to see how to copy your code into questions / comments properly, check the Markdown Cheatsheet link on this page below the answer box etc. when you're leaving an answer/comment, then we might be able to spot what's wrong in the complete code. )

6 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Matt;

It sounds like you are on Task 3 of the Write a CSS Selector and Property* Challenge.

At the end of Task 2 your code should look similar to:

<body>
    <style>
      h1 {}
    </style>
    <h1>Nick Pettit</h1>
</body>

Task 3 asks that you set the color of the h1 element to green, correct? So you need to add the color selector inside the h1 element and assign it a property of green.

Here is the final code for that challenge.

<body>
    <style>
      h1 {
        color: green;
      }
    </style>
    <h1>Nick Pettit</h1>
</body>

For future questions on the forum, please utilize the Markdown Cheatsheet examples for code insertion into posts. Also, please remember to mark posts as "Best Answer" when finished with your question(s).

Ethan Lowry
PLUS
Ethan Lowry
Courses Plus Student 7,323 Points

Do you have it in <style> tags in the head of the page, like it says?

Yes.

Awesome! Thanks for the tip

Anyhoo,

Try this again:

<style>

  h1 {
    color: blue;
  }
</style>

<h1>Something Else</h1>

Why doesn't this work?

Ethan Lowry
Ethan Lowry
Courses Plus Student 7,323 Points

You need to put that last line of triple backticks on the line immediately below your code, not at the end of an existing line.

Also remember to leave comments, not new answers (everybody does this, unfortunately this page isn't well designed in that regard)

EDIT: Nevermind, looks like you or someone else fixed it :)

Ethan Lowry
Ethan Lowry
Courses Plus Student 7,323 Points

And are the style tags in the <head> tags of the page? (Might or might not matter. What you have looks correct honestly so I'm looking for things the challenge might nitpick on.)

Aha! Was getting tripped up on placement of <body> tags. Thx for the help, guys! :-)