Set the color of the four borders.
The borders do not have to be the same, they can be set individually using from one to four values set in clockwise order:
Top Right Bottom Left
Top Right&Left Bottom
Top&Bottom Right&Left
AllBorders
Use the mnemonic TRouBLe to remember the order.
border-color: inherit will inherit border color from the parent element, this is required for elements such as <HR> which do not inherit by default.
The border-style property must be set before any border color properties can be applied.
Examples:
h1 { border-color: rgb(0,255,0); }
.emw3class { border-color: #93622f #000000; }
#emw3id { border-color: #2b5e55 #ff0000 #000000 #ffffff; }
Try it:
This is a sample of text with a CSS border. Each of the 4 borders can be styled together or separately with CSS. |
(CSS 1) Browser Support: All major browsers.
“Growing up, I never imagined a girl from a border town could one day become a governor” ~ Susana Martinez
Related:
Border-color - MDN Web Docs.
border-bottom-color - Color of the bottom border.
border-left-color - Color of the left border.
border-right-color - Color of the right border.
border-top-color - Color of the top border.
border-style - Style of the four borders.
border-width - Width of the four borders.
border - Shorthand to set all border properties.
outline-color - Color of an outline.