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

coding for color change

how do i code for a color change

index.html
<style>

  h1 {
  color: blue; 
  } 

</style>  
  <h1>Elizabeth Chipendo</h1>
</body>
Tim Sweeney
Tim Sweeney
15,101 Points

if you want to change the color of the h1 element (which I'm guessing) just change the color blue to whatever you want like red or green for example.

ok thank you but from the above format, where do you think i went wrong. i mearnt the format that i should follow

Tim Sweeney
Tim Sweeney
15,101 Points

what do you mean by format? what you've done is right is it not working? whats the code challenge asking you to do?

if your changing the color of the text then do as follows;

' ' 'CSS h1 { color: type the color here; } ' ' '

i used the h1 element in this example but this applies to any text elements such as ' ' 'html <a> ' ' ' ' ' ' 'html <p> ' ' ' and so on.

5 Answers

yah what i have done is being rejected that is the only problem

may be you can help me check if there is any error that i have made

Tim Sweeney
Tim Sweeney
15,101 Points

is it requiring you to write a selector and a property?

delete the color and see what happens

the selector is the h1 and the property is the color. the color itself is the value but i hasn't asked you to assign a value yet so just delete blue for now and see if that works.

Tim Sweeney
Tim Sweeney
15,101 Points

i just checked that challenge isn't it asking you to but a color of green not blue?

ok thank you, am i correct by putting my name

Tim Sweeney
Tim Sweeney
15,101 Points

ahaaa I didn't realise but you've accidentally deleted your opening body tag.

the body tag back in above the h1 and it will work

thanx hey, i am done on that one