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 trialDavid Kim
47 PointsWhat 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
8,378 PointsThe style tag is where you place your css code. Something like this
<body>
<style>
</style>
<h1>Nick Pettit</h1>
</body>
David Kim
47 PointsOops, 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
8,378 PointsIt should be like this
<body>
<style>
h1 {color:green;} // now the h1 color is set to green
</style>
<h1>Nick Pettit</h1>
</body>
James Anwyl
Full Stack JavaScript Techdegree Graduate 49,960 PointsHi 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.
David Kim
47 PointsAbraham: 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.
Kenny Nadel
7,695 PointsThe style tag should be played between the head tag, not the body tag.