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

Why is my <style> not working

I type <style> h1 <\style>

<h1>Megan McMullin<\h1>

Why is this not working

index.html
<style>h1<\style> 
  <h1>Megan McMullin</h1>

2 Answers

Hi 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.

THANK YOU!

Jesus Mendoza
Jesus Mendoza
23,289 Points

Hey Megan, first of all, there are 3 ways to implement a style in your html

  1. Using the <style></style> tag, that tag must be inside the <head></head> tag.
  2. Using inline style, that tag must be inside an HTML element, for example: <h1 style="color:blue;">Megan McMullin</h1> .
  3. 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.