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

Jarvis Cooper
Jarvis Cooper
179 Points

I am adding a css color command that will change the color of my html header, but I forget what to add where to referenc

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

what is wrong and/or missing?

index.html
<style>

{  style: blue;h1

</style>  }

<h1>Jarvis Cooper</h1>

4 Answers

So the structure of css is like this

<css selector> {
   <css property> : <property value>;
}

Now let's fill in this structure with what we want which is to change the text color of header element

header {
  color : white;
}
Kelly von Borstel
Kelly von Borstel
28,880 Points

Hi, Jarvis. Here's an example of how to add styles to html. Try following this format and see if it works.

<style>
  p {
    font-size: .8em;
    padding: 5px;
  } 
</style>
jeremy hudson
jeremy hudson
2,589 Points

you need a selector that targets your header for example header { background-color: blue; }

<style>

header: { background-color: blue; };

</style>

and if you want to change fonts color you must write code like example below:

<style>

header h1 { color: blue; }

</style>