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

Keith Corona
Keith Corona
9,553 Points

Border default color with non-text items

Hello,

In the lesson we are told that the border color defaults to the color of the text, however, if the item we are wanting to put a border around is, say, a picture, then what would the border color default to?

2 Answers

Martin Murphy
Martin Murphy
19,321 Points

Someone correct me if I am wrong but the default colour on an image would default to black. Say if you applied a style such as:

img {
  border: 1px solid;
}

This would create a black border around the image.

Esteban Valdez
seal-mask
.a{fill-rule:evenodd;}techdegree
Esteban Valdez
Front End Web Development Techdegree Student 8,858 Points

I believe that the border color is inherited from the User Agent Style Sheet. This is the style imported from the browser. Which is most likely black.