The border properties allow you to specify how the border of the box representing an element should look. There are three properties of a border you can change
1. The border-color Specifies the color of a border.
2. The border-style Specifies whether a border should be solid, dashed line, double line, or one of the other possible values.
3. The border-width Specifies the width of a border.
The border-style Property:
The border-style property allows you to select one of the following styles of border:
none: No border. (Equivalent of border-width:0;)
solid: Border is a single solid line.
dotted: Border is a series of dots.
dashed: Border is a series of short lines.
double: Border is two solid lines.
groove: Border looks as though it is carved into the page.
ridge: Border looks the opposite of groove.
inset: Border makes the box look like it is embedded in the page.
outset: Border makes the box look like it is coming out of the canvas.
hidden: Same as none, except in terms of border-conflict resolution for table elements.
Examples:
<p style="border-width:4px; border-style:none;">
This is a border with none width.
</p>
<p style="border-width:4px; border-style:solid;">
This is a solid border.
</p>
<p style="border-width:4px; border-style:dashed;">
This is a dahsed border.
</p>
<p style="border-width:4px; border-style:double;">
This is a double border.
</p>
<p style="border-width:4px; border-style:groove;">
This is a groove border.
</p>
<p style="border-width:4px; border-style:ridge">
This is aridge border.
</p>
<p style="border-width:4px; border-style:inset;">
This is a inset border.
</p>
<p style="border-width:4px; border-style:outset;">
This is a outset border.
</p>
<p style="border-width:4px; border-style:hidden;">
This is a hidden border.
</p>
CSS Outlines
An outline is a line that is drawn around elements (outside the borders) to make the element "stand out". The outline properties specify the style, color, and width of an outline.
However, the outline property is different from the border property.
outline Property
Example:
<html>
<head>
<style>
p
{
border:1px solid red;
outline:green dotted thick;
}
</style>
</head>
<body>
<p>Supports the outline properties only</p>
</body>
</html>
outline-color Property
The outline-color property specifies the color of an outline.
Example:
p
{
outline-style:dotted;
outline-color:#00ff00;
}
outline-style Property
The outline-style property specifies the style of an outline.
Example:
p
{
outline-style:dotted;
}
outline-width Property
The outline-width specifies the width of an outline.
Example:
p
{
outline-style:dotted;
outline-width:5px;
}