properties that allow you to specify the style, width, and color of an element’s border
CSS border
property specifies what kind of border to display
border-style
ex. p.dotted {border-style: dotted;}
The following border values are allowed:
property specifies the width of the four borders
border-width
p.one {
border-style: solid;
border-width: 5px;
}
p.two {
border-style: solid;
border-width: medium;
}
p.three {
border-style: dotted;
border-width: 2px;
}
p.four {
border-style: dotted;
border-width: thick;
}The border-width property can have from one to four values
top, right, bottom, left
p.one {
border-style: solid;
border-width: 5px 20px; /* 5px top and bottom, 20px on the sides */
}
p.two {
border-style: solid;
border-width: 20px 5px; /* 20px top and bottom, 5px on the sides */
}
p.three {
border-style: solid;
border-width: 25px 10px 4px 35px; /* 25px top, 10px right, 4px bottom and 35px left */
}property is used to set the color of the four borders
border-color
The border color can be set by
If border-color is not set, it inherits the color of the element
The border-color property can have from one to four values
top, right, bottom, left
p.one {
border-style: solid;
border-color: red green blue yellow; /* red top, green right, blue bottom and yellow left */
}In CSS, there are also properties for specifying each of the borders
border-top-style
border-right-style
border-bottom-style
border-left-style
p {
border-top-style: dotted;
border-right-style: solid;
border-bottom-style: dotted;
border-left-style: solid;
}The border property is a shorthand property for the following individual border properties:
border-width
border-style (required)
border-color
p {
border: 5px solid red;
}property is used to add rounded borders to an element
border-radius