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

CSS How to Make a Website Beginning HTML and CSS Write a CSS Selector and Property

how do i make the h1 green

can u help me

index.html
<body>NaudiaLopez
    <h1>Nick Pettit</h1>
</body>NaudiaLopez<style>
h1{NaudiaLopez}h1

Naudia, you can write the CSS to make your h1 green inline, in your internal stylesheet, or in your external stylesheet (a separate file ending in .css to which you link from within your html <head> tag.

Inline:

<body>
    <h1 style="color: green;">Nick Pettit</h1>
</body>

Internal stylesheet:

<head>
    <style>
        h1 {
            color: green;
        }
    </style>
</head>
<body>
    <h1>Nick Pettit</h1>
</body>

External stylesheet: Create a file called styles.css in the same folder as your html file and include:

h1 {
  color: green;
}

...then in your html file link to it:

<head>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <h1>Nick Pettit</h1>
</body>

Let me know if you have questions!

1 Answer

Hi Naudia,

to make the h1 green you have to insert the following code into an external stylesheet which would have to be linked to from the HTML file:

h1 {color: green}

or you could place the style tags inside the head tags containing the same code and would look like this:

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