In CSS, the border
property is used to define the border around elements. You can customize borders using various properties including width, style, and color.
The border-width
property sets the width of the border. For example:
div {
border-width: 5px;
border-style: solid;
border-color: #333;
}
The border-style
property sets the style of the border. For example:
div {
border-style: dashed;
border-width: 2px;
border-color: #333;
}
The border-color
property sets the color of the border. For example:
div {
border-color: #ff6347;
border-style: solid;
border-width: 4px;
}
The border-radius
property defines the radius of the element's corners. For example:
div {
border-radius: 15px;
border-style: solid;
border-width: 3px;
border-color: #333;
}
The border
shorthand property sets the border width, style, and color all at once. For example:
div {
border: 2px solid #000;
}
You can create multiple borders using the border
property with multiple values. For example:
div {
border: 5px solid #ff6347;
border: 10px double #333;
}