border
jameskeezer23 total contributions
Published Jul 28, 2021Updated Nov 16, 2023
Contribute to Docs
Shorthand property that sets different properties for an element’s border in a single declaration.
Syntax
border: <values>;
The border
property accepts one or more of the following properties as values:
border-style
(required)border-color
border-width
Example 1
Setting a div
elements border style to dashed.
div {/* <border-style> */border: dashed;}
The following image demonstrates the code block above:
Example 2
Setting an img
elements border to dotted, red and a width of 20px.
div {/* <border-width> | <border-style> | <border-color> */border: 20px dotted red;}
The following image demonstrates the code block above:
All contributors
- jameskeezer23 total contributions
- christian.dinh2476 total contributions
- Anonymous contributorAnonymous contributor3071 total contributions
- asiqurr43 total contributions
- jameskeezer
- christian.dinh
- Anonymous contributor
- asiqurr
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.