Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML Introduction to HTML and CSS Make It Beautiful With CSS Select and Style by Class

Border Question?

So, u don't have to create multiple properties border, width etc like they did in csstricks.com?Why is the video syntax different from the website

2 Answers

the property border is shorthand for all of these properties combined. It includes width, color and style, for all 4 borders.

Rohald van Merode
.a{fill-rule:evenodd;}techdegree seal-36
Rohald van Merode
Treehouse Staff

Hi Mohamud,

The border property is a shorthand property, in the border property you can set the values for border-width, border-style and border-color.

The link to css-tricks that is at the references page shows the same. The reason that the first example includes width and height is to give the box a size. If the box didn’t have any width or height it wouldn’t be able to display the border.

I hope this answered your question.