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 trialMegan McMullin
7,980 PointsWhy is my <style> not working
I type <style> h1 <\style>
<h1>Megan McMullin<\h1>
Why is this not working
<style>h1<\style>
<h1>Megan McMullin</h1>
2 Answers
bothxp
16,510 PointsHi Megan,
For that challenge the 3 steps are:
<style>
</style>
<h1>Nick Pettit</h1>
<style>
h1 {}
</style>
<h1>Nick Pettit</h1>
<style>
h1 {color: green;}
</style>
<h1>Nick Pettit</h1>
So i believe that in your answer to task 2 you have just forgotten to add the curly brackets after the h1.
Jesus Mendoza
23,289 PointsHey Megan, first of all, there are 3 ways to implement a style in your html
- Using the
<style></style>
tag, that tag must be inside the<head></head>
tag. - Using inline style, that tag must be inside an HTML element, for example:
<h1 style="color:blue;">Megan McMullin</h1>
. - Using an external CSS file and importing it inside the head element using the
<link rel="stylesheet" type="text/css" href="main.css">
tag.
After you use on of the methods that I mentioned above, you have to declare a correct style property, for example
h1 {
color: red;
}
if you're declaring it on a external or inside the <style></style> tag.
<h1 style="color:red">Megan McMullin</h1>
if you're declaring it inside an inline tag.
Megan McMullin
7,980 PointsMegan McMullin
7,980 PointsTHANK YOU!