WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

CSS Outline


CSS Outline Properties

Outlines are like fringes ,A framework is a line drawn around a component - outside the outskirt. This can be use to make a component "stand out".

The CSS outline properties indicate the style, shading, and width of an outline.

Outlines don't need to be rectangular.


CSS Outline

An layout is a line that is drawn around components (outside the fringes) to make the component "stand out".

Outline is dependably the equivalent on all sides.


Outline Style

The outline-style property determines the style of the outline.

The outline-style property can have one of the accompanying values:

  • dotted - Defines a spotted outline
  • dashed - Defines a dashed outline
  • solid - Defines a strong outline
  • double - Defines a twofold outline
  • groove - Defines a 3D notched diagram. The impact relies upon the framework shading value
  • ridge - Defines a 3D furrowed layout. The impact relies upon the framework shading value
  • inset - Defines a 3D inset blueprint. The impact relies upon the layout shading value
  • outset - Defines a 3D beginning layout. The impact relies upon the blueprint shading value
  • none - Defines no outline
  • hidden - Defines a shrouded outline

The following precedent first sets a meager dark fringe around each <p> component, at that point it demonstrates the diverse outline-style values:

Example

p {
    fringe: 1px strong black;
    plot shading: red;
}

p.dotted {outline-style: dotted;}
p.dashed {outline-style: dashed;}
p.solid {outline-style: solid;}
p.double {outline-style: double;}
p.groove {outline-style: groove;}
p.ridge {outline-style: ridge;}
p.inset {outline-style: inset;}
p.outset {outline-style: outset;}

Result:

A dabbed outline.

A dashed outline.

A strong outline.

A twofold outline.

A groove plot. The impact relies upon the layout shading value.

A edge layout. The impact relies upon the layout shading value.

An inset framework. The impact relies upon the framework shading value.

An beginning framework. The impact relies upon the blueprint shading value.

Try it yourself »

Outline Color

The outline-color property is utilized to set the shade of the outline.

The shading can be set by:

  • name - indicate a shading name, as "red"
  • RGB - indicate a RGB esteem, as "rgb(255,0,0)"
  • Hex - determine a hex esteem, as "#ff0000"
  • invert - plays out a shading reversal (which guarantees that the framework is obvious, paying little heed to shading background)

Example

p {
    fringe: 1px strong black;
    plot style: dashed;
    plot shading: hotpink;
}

Result:

A hued outline.

Try it yourself »

Outline Width

The outline-width property indicates the width of the outline.

The width can be set as a particular size (in px, pt, cm, em, and so forth) or by utilizing one of the three pre-characterized qualities: slight, medium, or thick.

Example

p {border: 1px strong black;}

p.one {
    layout style: dotted;
    diagram shading: yellow;
    layout width: thick;
}

p.two {
    layout style: double;
    diagram shading: hotpink;
    layout width: 3px;
}

Result:

A thick outline.

A more slender outline.

Try it yourself »

Outline - Shorthand property

To abbreviate the code, it is additionally conceivable to determine all the person layout properties in one property.

The outline property is a shorthand property for the accompanying person plot properties:

  • outline-width
  • outline-style (required)
  • outline-color

Example

p {
    fringe: 1px notch black;
    plot: 5px spotted green;
}

Result:

An outline.

Try it yourself »