
- 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 outline-color Property in CSS
The outline-color property can be defined to draw a line of specific color around the borders of the element, but the outline is not a part of element’s dimensions unlike border property.
Syntax
The syntax of CSS outline-color property is as follows −
Selector { outline-color: /*value*/ }
NOTE − The outline-style property needs to be defined before declaring outline-color.
Example
Let’s see an example for outline-color property −
<!DOCTYPE html> <html> <head> <title>CSS outline-color</title> <style> span { margin: 15px; padding: 20px; border-style: solid; border-color: #f28500 #dc3545; position: absolute; outline-width: 5px; outline-style: double; outline-color: green; border-radius: 50%; } #showDiv { margin:auto; border-style: solid; border-color: darkmagenta dodgerblue; outline-style: groove; outline-color: black; height: 80px; width: 80px; } #container { width:50%; margin:50px auto; } </style> </head> <body> <div id="container"> <div id="showDiv"><span></span></div> </div></body></html>
Output
Following is the output for the above code −
Example
Let’s see another example for outline-style property −
<!DOCTYPE html> <html> <head> <title>CSS outline-color</title> <style> #container { width:50%; margin:50px auto; } p { margin:auto; border-style: ridge; border-width: 10px; border-color: lightblue; outline-style: dashed; outline-width: 5px; outline-color: violet; } </style> </head> <body> <div id="container"> <p>Reach millions of professionals with video tutorials.</p> </div> </body> </html>
Output
Following is the output for the above code −
- Related Articles
- CSS outline-color property
- Animate CSS outline-color
- CSS outline property
- The outline-width Property in CSS
- The outline-style Property in CSS
- The outline Shorthand Property in CSS
- CSS outline-style property
- CSS outline-width property
- Set the color of the outline with CSS
- Animate CSS outline-offset property
- The border-color Property in CSS
- Setting Color Property in CSS
- CSS caret-color Property
- Usage of color property in CSS
- Usage of background-color property in CSS

Advertisements