CSS - Outline

Outline

In this tutorial, I will be showing you all you need to know about outline and how to format it the way you desire.

definition
DEFINITION:

Outline is the line outside the border of an element.

Outline Properties

OUTLINE STYLE

The outline-style property is used to set the style of the outline. Its values include:

  • dotted
  • dashed
  • solid
  • double
  • groove - 3D grooved outline
  • ridge - 3D ridge outline
  • inset - 3D inset outline
  • outset - 3D outset outline
  • none - no outline
  • hidden - not visible (cannot be seen)

OUTLINE WIDTH

The outline-width property is used to set the thickness or thinness (weight) of the outline.

OUTLINE COLOR

The outline-color property is used to specify the color of the outline-style value.

note
NOTE:

outline-style must be declared first before declaring outline-width and outline-color else your border effect will not be visible.


Outline (Shorthand)

OUTLINE OFFSET

The outline-offset property is used to specify the space between the outline and the border of the element.

ADVERTISEMENTS

LEARNING IS A CONTINOUS PROCESS - PRACTICE MAKES PERFECT