CSS Outlines

Parameter details:
- dotted - dotted outline
- dashed - dashed outline
- solid- solid outline
- double- double outline
- groove- 3D grooved outline depends on the outline-color value
- ridge- 3D ridged outline depends on the outline-color value
- inset- 3D inset outline depends on the outline-color value
- outset- 3D outset outline depends on the outline-color value
- none- no outline
- hidden- hidden outline
Overview
The outline is a line that goes around the element, outside of the border. In contrast to borders, outlines do not take any space in the box model. So adding an outline to an element does not affect the position of the element or other elements.
In addition, outlines can be non-rectangular in some browsers. This can happen if the outline is applied to a span element that has text with different font-size properties inside it. Unlike borders, outlines cannot have rounded corners.
The essential parts of the outline are outline-color, outline-style, and outline-width.
The definition of an outline is equivalent to the definition of a border:
outline: 1px solid black;
Outline-style
The outline-style property is used to set the style of the outline of an element.
CSS
p
{
border: 1px solid black;
outline-color: blue;
line-height: 30px;
}
.p1
{
outline-style: dotted;
}
.p2
{
outline-style: dashed;
}
.p3
{
outline-style: solid;
}
.p4{
outline-style: double;
}
.p5{
outline-style: groove;
}
.p6{
outline-style: ridge;
}
.p7{
outline-style: inset;
}
.p8{
outline-style: outset;
}
HTML:
<p class="p1">A dotted outline</p>
<p class="p2">A dashed outline</p>
<p class="p3">A solid outline</p>
<p class="p4">A double outline</p>
<p class="p5">A groove outline</p>
<p class="p6">A ridge outline</p>
<p class="p7">An inset outline</p>
<p class="p8">An outset outline</p>
ATutorialHub Related Guide
Comments (9)
User Comments

panduranga gupta
2021-07-05 07:03:13good website for learning and help me a lot

raju
2021-09-25 14:58:47The awsome website i am looking like for a long time, good work atutorialhub team keep doing

Shivani
2021-09-01 15:03:56Learning a lot from the courses present on atutorialhub. The courses are very well explained. Great experience

Harshitha
2021-09-10 15:05:45It is very helpful to students and easy to learn the concepts

Sowmya
2021-09-14 15:06:41Great job Tutorials are easy to understand Please make use of it

Zain Khan
2021-09-18 15:07:23Great content and customized courses.

Rudrakshi Bhatt
2021-09-09 15:08:10Well structured coursed and explained really well!

Pavana Somashekar
2021-09-11 15:09:08Good platform for beginners and learn a lot on this website

Sax
2021-09-25 19:35:50Nice website
Leave a Comment