
- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursors
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS Advanced
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Media Types
- CSS - Paged Media
- CSS - Aural Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS3 - Rounded Corner
- CSS3 - Border Images
- CSS3 - Multi Background
- CSS3 - Color
- CSS3 - Gradients
- CSS3 - Shadow
- CSS3 - Text
- CSS3 - Web font
- CSS3 - 2d transform
- CSS3 - 3d transform
- CSS3 - Animation
- CSS3 - Multi columns
- CSS3 - User Interface
- CSS3 - Box Sizing
- CSS Responsive
- CSS - Responsive Web Design
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
The border-color Property in CSS
The CSS border-color property is used to specify a border color for elements. We can also set color for individual sides using border-top-color, border-right-color, border-left-color and border-right-color properties.
Syntax
The syntax of CSS border-color property is as follows −
Selector { border-color: /*value*/ }
The following examples illustrate CSS border-color property −
Example
<!DOCTYPE html> <html> <head> <style> span { margin: 10px; padding: 20px; border-style: solid; border-color: limegreen lightblue crimson; } div { text-align: center; border-style: solid; border-color: palevioletred steelblue; height: 16px; } </style> </head> <body> <h2>Demo Heading</h2> <div>Demo</div> <p><span>This</span>is demo text just for displaying how CSS styles works.</p> </body> </html>
Output
This gives the following output −
Example
<!DOCTYPE html> <html> <head> <style> li { border-bottom-color: cyan; border-bottom-style: dotted; width: 300px; } p { text-align: center; border-width: 8px; border-style: solid; border-color: #d11c74; border-left-style: ridge; } </style> </head> <body> <h2>Accessories</h2> <p>Displaying the car accessories</p> <ul> <li>Mud Flap</li> <li>Car Freshener</li> <li>Mobile Holder</li> <li>Bluetooth</li> <li>Wheel Lock</li> </ul> </body> </html>
Output
This gives the following output −
- Related Articles
- Usage of border-color property in CSS
- Animate border-color property with CSS
- Animate CSS border-left-color property
- Animate CSS border-top-color property
- Usage of border-top-color property in CSS
- Usage of border-right-color property in CSS
- Usage of border-bottom-color property in CSS
- Usage of border-left-color property in CSS
- Perform Animation on CSS border-bottom-color property
- The border-style Property in CSS
- The border-width Property in CSS
- The border Shorthand Property in CSS
- Animate CSS border property
- CSS border-radius property
- CSS border-image property

Advertisements