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?

Tomasz Necek
PLUS
Tomasz Necek
Courses Plus Student 7,028 Points

What if I want to add two things in one place like:

<style> footer {color:green; nav color:blue;} </style>

or <style> footer {color:green;} nav {color:blue;} </style>

In the head .

It doesn't work for me.

If I want to write in <head> two or more things like : footer gree, nav:blue etc.. Thanks

1 Answer

Tobias Helmrich
Tobias Helmrich
31,602 Points

Hey there Tomasz,

I'm not sure if I understand your question correctly but if you want to give certain elements different values for the same property the second code snippet you posted should actually work.

If you want the text in your footer to be green and the text in your nav element to be blue this should work:

footer {
  color: green;
}

nav {
  color: blue;
}

However your first example won't work because you have to end each rule for an element with a closing curly brace and open the next one with an opening curly brace. I hope I understood your question correctly and that I could help, if not please let me know! :)