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 Foundations The Box Model The CSS Box Model Concept

Mike Spotten
Mike Spotten
3,074 Points

Color and border

I never knew that the color property would affect a non-defined border as shown in this video. Why does this happen?

I'm more curious than anything, as I normally define my borders as border:1px solid black; for example and include the color which overrides this behavior.

1 Answer

christopher smith
christopher smith
5,831 Points

I had never noticed that either. Found this while I was looking into it.

Default values If no color is specified for the border, the border has the same value as the element itself, that is the value specified by the color property. Note that this does not mean that all elements have a default border of the same color as the color of their content. It means that if you set a border-style only, your border will be drawn with a default color the same as the color of the element.