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 trialkatrinadunne
5,308 PointsStyle Tag Missing
This is the style code I wrote. The challenge tells me I'm missing a style tag. What's wrong with this code?
<style>
h1 {
color: blue;
}
</style> <body> <h1>Nick Pettit</h1> </body>
Dustin Scott
Courses Plus Student 7,819 PointsWhy don't you post the code you typed in the code challenge to know what is the problem if you can.
4 Answers
Dustin Scott
Courses Plus Student 7,819 PointsYou have to write it this way:
<style>
h1 {
color: blue;
}
</style>```
Hope it works with you
notf0und
11,940 PointsAs Dustin Scott says, the challenge is to apply style via the <style> </style>
tags.
<body>
<style>h1 {color: blue}</style>
<h1>Nick Pettit</h1>
</body>
Jaynie Williams
603 Points<style> h1 {color: blue;} </style>
Shane Keene
391 PointsDustin Scott and Bryan H are correct. What you have posted above is a CSS rule, not a style tag. The rule needs to be embedded within the style tags.
katrinadunne
5,308 Pointskatrinadunne
5,308 PointsWhen I click on the preview it shows that I've done it correctly. The text turns blue like it's supposed to, but when I check my work it says I'm missing a style tag. The style tag is definitely there. If it wasn't then I would assume that the preview would be incorrect. I've tried the suggestions I received, but it doesn't seem to make a difference. I don't know how to get the challenge to recognize that there is a style tag.