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

CSS

In How to Make a Website, after writing my style element above h1, as instructed, I am then told to write CSS (make the heading green) but I am doing something wrong.

Stone Preston
Stone Preston
42,016 Points

can you post the code you are using. You will need to format it using markdown to make it appear in the forum. This post has instructions on doing that.

<body> <style> { color: green <h1>DavidDoswell</h1> } </style> </body>

4 Answers

for me I had to put the thing directly on top of the h1 element, within the body.

I did that. Wait, you mean straight across?

Also, no backward tics - iPad.

Jahan Zeb
Jahan Zeb
11,169 Points

Two ways to do this:

Define style within h1 tag:

<h1 style="color: green;">DavidDoswell</h1>

Define h1 style prior to h1 tag

<style>
    h1 {color: green;}
</style>
<h1>DavidDoswell</h1>