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 CSS Basics (2014) Basic Selectors Type Selectors

Ingrid Bardales
Ingrid Bardales
10,616 Points

In CSS Basics, Gill set the body color to grey, I was wondering if setting background-color to grey would work also?

Was wondering if there is a difference between 'color' and 'background-color' in defining color to the body. I was under the impression that 'color' was used for font only.

thanx in advance for the help! Ingrid

2 Answers

Steven Treadway
Steven Treadway
10,037 Points

Yes there is a difference. You are right about color being text only.

Ingrid Bardales
Ingrid Bardales
10,616 Points

Thanks Steven, but why did Guil use the property 'color' instead of 'background-color' for the body?

Thanks again!

Follow up question: I see the color of the links are still blue. Links are then not related to the body selector, I suppose?

Steven Treadway
Steven Treadway
10,037 Points

Because he wanted to change the text color of the body, not the background color. You can use the background-color property on the body if you'd like, that's just not what he decided to do in the video. But once again, the two properties do two different things.