border Property

By: Dusty Arlia
Published on Thursday, July 18, 2013, 08:27 PM
Last Updated on Sunday, July 05, 2015 at 9:02 PM
Total Updates: 3

The CSS border property sets all the border properties in one declaration. Here is its basic syntax:

border: [border-width] | [border-style] | [border-color];

And here is an example:

div {
    border: 2px solid black;

You are allowed to exclude one of the values. For example:

border: solid black; allowed. When you use the border property, this is considered the shorthand method, because you can take care of its width, style, and color all at once.