

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
The outline-style Property in CSS
The outline-style property can be defined to draw a line 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-style property is as follows −
Selector { outline-style: /*value*/ }
Example
Let’s see an example of outline-style property −
<!DOCTYPE html> <html> <head> <title>CSS outline-style</title> <style> span { margin: 15px; padding: 20px; border-style: solid; border-color: #dc3545; position: absolute; outline-width: 5px; outline-style: double; outline-color: orange; 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 above code −
Example
Let’s see another example of outline-style property −
<!DOCTYPE html> <html> <head> <title>CSS outline-style</title> <style> #container { width:50%; margin:50px auto; } p { margin:auto; border-style: ridge; border-width: 10px; border-color: lightblue; outline-style: dashed; outline-color: violet; } </style> </head> <body> <div id="container"> <p>Video Tutorials helps in understanding the technology with live running examples and practical implementation.</p> </div> </body></html>
Output
Following is the output for above code −
- Related Questions & Answers
- CSS outline-style property
- CSS outline property
- HTML DOM Style outline Property
- The outline-width Property in CSS
- The outline-color Property in CSS
- The outline Shorthand Property in CSS
- CSS outline-color property
- CSS outline-width property
- Set the line style for the outline with CSS
- Animate CSS outline-offset property
- Set outline style as ridge with CSS
- How to style outline buttons with CSS?
- The border-style Property in CSS
- Set outline style as a groove with CSS
- The list-style Shorthand property in CSS
Advertisements