Outline Properties

CSS outline properties control the outer border of an element, similar to borders but without affecting layout size. They are often used for accessibility and focus indicators.


PropertyPossible ValuesDescription
outlinewidth style colorShorthand for setting outline properties
outline-widththin, medium, thick, px, emSets the thickness of the outline
outline-stylesolid, dashed, dotted, double, groove, ridge, noneDefines the style of the outline
outline-colorcolor name, hex, rgb, transparentSpecifies the color of the outline
outline-offsetpx, emAdds space between the outline and the element's border

Explanation of Values

Value TypeDescriptionExample
thin, medium, thickPredefined widthsoutline-width: thick;
px, emCustom width valuesoutline-width: 5px;
solidContinuous lineoutline-style: solid;
dashedDashed outlineoutline-style: dashed;
dottedDotted outlineoutline-style: dotted;
doubleDouble-line outlineoutline-style: double;
outline-offsetMoves outline away from the borderoutline-offset: 4px;

Example 

button {
    outline: 2px dashed red;
    outline-offset: 5px;
}

Programs

css code to design a box using div with following specifications

View Solution


css code to design a circle using div with following specifications

View Solution


css code to change the square into circle when mouse is over to the square shape

View Solution


css code to create 3 different colors box which partially overlapped to each other

View Solution


CSS code to blink text using keyframes

View Solution


Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad