×
FREE ASSISTANCE FOR THE INQUISITIVE PEOPLE
Tutorial Topics
X
softetechnologies
CSS Border property display the border on HTML page CSS BOX MODEL (How to Design a Div)
CSS outline Property | set the outline - CSS 3.0
3014    Arnab De    11/05/2017

CSS Outline property

We can specify an outline of the border of a HTML elements.

Note: The width and height of any elements is not a part of it dimension.

We can change the outline style of a section of HTML use the border-style property. outline-style property has the following values

  • dotted: dotted border
  • dashed: dashed border
  • solid: solid border
  • double: double border
  • groove: 3D grooved border
  • ridge: 3D ridge border
  • inset: 3D inset border
  • outset: 3D outset border
  • none: no border
  • hidden: hidden border
softetechnologies

outline is often used for accessibility reasons that is to emphasize a link when tabbed to without affecting positioning and in a different way than hover.

Example 1

CSS Code

div
{
border-style:solid;
border-color:red;
outline-color:green;
outline-width:5px;
margin:25px;
}
.dotted
{
outline-style:dotted;
}
.dashed
{
outline-style:dashed;
}
.solid
{
outline-style:solid;
}
.double
{
outline-style:double;
}
.groove
{
outline-style:groove;
}
.ridge
{
outline-style:ridge;
}
.inset
{
outline-style:inset;
}
.outset
{
outline-style:outset;
}
.none
{
outline:none;
}

.hidden
{
outline:hidden;
}

softetechnologies


HTML Code

<!DOCTYPE html>
<html>
<head>
<title>Border Demo</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="dotted">Dotted</div>
<div class="dashed">Dashed</div>
<div class="solid">Solid</div>
<div class="double">Double</div>
<div class="groove">Groove</div>
<div class="ridge">Ridge</div>
<div class="inset">Inset</div>
<div class="outset">Outset</div>
<div class="none">None</div>
<div class="hidden">Hidden</div>
</body>
</html>

Types Od Outlines
Types Od Outlines

Note: IE8 supports the outline properties only if a !DOCTYPE is specified.

CSS Border property display the border on HTML page CSS BOX MODEL (How to Design a Div)
softetechnologies
Author Details
Arnab De
I have over 16 years of experience working as an IT professional, ranging from teaching at my own institute to being a computer faculty at different leading institute across Kolkata. I also work as a web developer and designer, having worked for renowned companies and brand. Through tutorialathome, I wish to share my years of knowledge with the readers.
Enter New Comment
Comment History
No Comment Found Yet.
Albert Einstein
The only source of knowledge is experience.
Albert Einstein
406
87.13
Today So Far
Total View (Lakh)
softetechnologies
26/05/2018     55085
25/06/2018     46218
01/01/2018     44284
28/06/2017     41899
02/08/2017     40997
01/08/2017     34976
06/07/2017     34721
15/05/2017     33905
11/09/2018     31749
14/07/2017     30881
softetechnologies