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

What is a style tag?

It keeps on telling me I forgot a style tag, this is the code I put in.

<style> h1 {color: blue;} </style>
<h1>David Kim</h1>

Isn't <style> the style tag? Am I missing something?

4 Answers

Abe Layee
Abe Layee
8,378 Points

The style tag is where you place your css code. Something like this

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

Oops, parts of my code did not show up when I posted.

That's more or less what I put in the code (I didn't have the <> body tag on it though). In between the <> style I typed "h1 {color:red;}"

Abe Layee
Abe Layee
8,378 Points

It should be like this

  <body>
  <style>
    h1 {color:green;} // now the h1 color is set to green
  </style>
    <h1>Nick Pettit</h1>
</body>

Hi David. The style tag was there in your original post but it was hidden because of the way forum posts are formatted. I've edited your post to fix this, check out this guide for info.

Abraham: I added the body tag and changed the color to green and that seemed to work for some reason.

James: Also really useful to know I'll do that next time I get stuck.

I thank you sirs, you both are genii, a gentlemen, and a paragons for all that is good in the world.

The style tag should be played between the head tag, not the body tag.