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

Michael Yom
PLUS
Michael Yom
Courses Plus Student 4,762 Points

why doesn't this code work.. okay i can't even paste my code in the description..

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

<body> <h1>Myom</h1> </body>

Why doesn't this work..

3 Answers

Domen Stojic
Domen Stojic
31,376 Points

Hi!

You probably forgot style tag! And the color is green!

<body>
  <style>h1{color: green;}</style>
    <h1>Nick Pettit</h1>
</body>
idan ben yair
idan ben yair
10,288 Points

are you applying this code to a CSS file or straight to the html file? if you are doing it like domen is suggesting than thats the way it should be done if not and you need to link the css file and html file together, the way that you will do that is by implementing the following code to youre html file:

<link href = "style.css" rel = "stylesheet" type = "css/text">

please remember that href should be the name if the css file. Hope that helped!

Michael Yom
PLUS
Michael Yom
Courses Plus Student 4,762 Points

Thanks for your help! I actually figured it out now.