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 CSS: Cascading Style Sheets What is CSS?

Ryan Petchenick
Ryan Petchenick
11,439 Points

Color of Footer text won't change to green

The color of my footer text won't change to green.

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Ryan Petchenick | Designer</title>
<link rel="stylesheet" href="css/normalize.css"> <style> footer { color: green; } </style>

Neil Anuskiewicz
Neil Anuskiewicz
11,007 Points

I think it would be easier to troubleshoot if you posted more of the code. i don't see the opening style tag and I don't see footer html with that you're targeting. Is it a class as in .footer or something as you just footer no . in front of it.

You have no opening "style" tag.

2 Answers

Neil Anuskiewicz
Neil Anuskiewicz
11,007 Points

Actually, maybe that is enough code if it's a class, I think you need a .footer right? Worth a try.

Hi Ryan,

Yes, it would be useful to see more of your code, especially the HTML of the footer.

One suggestion, try targeting the specific text element. For example, if it's a <p> tag, something like:

footer p {
  color: green;
}

This way, you're targeting the element a little more specifically.

All the best,

Ede

Neil Anuskiewicz
Neil Anuskiewicz
11,007 Points

Ede, oops, did I give bad advice with the suggestion of a .footer for class?

Hi Neil,

Not at all :) If it's a class named 'footer', then you would target it as:

.footer

I've just noticed that Adam has spotted the mistake though. There's no opening 'style' tag.

Ryan, your full code should be:

<meta charset="utf-8">
<title>Ryan Petchenick | Designer</title>  
<link rel="stylesheet" href="css/normalize.css">
<style>
footer {
   color: green;
 }
</style>

Ede

Neil Anuskiewicz
Neil Anuskiewicz
11,007 Points

ede, it's actually targeting the footer element not a class. That was my mis guided thinking. Thank you. So, as you noted, the correct answer is this:

<style>
footer p {
color: green;
}
</style>