border: ***; border-***: ***;
Browser |
|
---|
The border and border-*** properties are a shorthand property for setting all border properties.
(*** = top, bottom, left, and right)
- border : This is a shorthand property for setting all border properties for the four borders.
- border-*** : Sets all border properties of the top, bottom, left, and right borders.
div {
border: thick red solid;
}
p {
border-top: 2px #85b9e9 solid;
border-right: 4px #bde9ba double;
border-bottom: 6px #ffd37d dotted;
border-left: 8px #d1d1d1 dashed;
}
border : This is a shorthand property for setting all border properties for the four borders.
Property | Value | Explanation |
---|---|---|
border | each value | sets width, color, and style |
border: thick red solid;
The unnecessary values can be omitted.
border: thick solid;
Please note that the default value of border style is "none".
border-*** : Sets all border properties of the top, bottom, left, and right borders.
Property | Value | Explanation |
---|---|---|
border-top | each value | the top border |
border-right | each value | the right border |
border-bottom | each value | the bottom border |
border-left | each value | the left border |
border-top: 2px #85b9e9 solid;
border-right: 4px #bde9ba double;
border-bottom: 6px #ffd37d dotted;
border-left: 8px #d1d1d1 dashed;