CSS Shorthand Border Property

CSS is the language we use to style an HTML document.
CSS describes how HTML elements should be displayed.
This tutorial will teach you CSS from basic to advanced.
Post Reply
Guest

CSS Shorthand Border Property

Post by Guest »

CSS Shorthand Border Property


CSS Border - Shorthand Property
Like you saw in the previous page, there are many properties to consider when dealing with borders.
To shorten the code, it is also possible to specify all the individual border properties in
one property.
The border property is a shorthand property for the following individual border properties:

border-width
border-style (required)
border-color


Example

p { 
border: 5px solid red;}
Result:

Some text

Try it Yourself »

You can also specify all the individual border properties for just one side:

Left Border

p { 
border-left: 6px solid red;}
Result:

Some text

Try it Yourself »


Bottom Border

p { 
border-bottom: 6px solid red;}
Result:

Some text

Try it Yourself »














+1

Reference: https://www.w3schools.com/css/css_border_shorthand.asp
Post Reply