Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

outline-color — outline color

The outline-color property sets an element’s outline color without changing its size or the page layout.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

outline-color: auto | <'border-top-color'>;

outline-color colors the outline, not the border. It is not inherited. Color alone cannot reveal an outline with outline-style: none; the example explicitly sets style and width.

Level 4 accepts auto and border-top-color values, including colors and currentColor. Initial auto represents the accent color with outline-style: auto; otherwise it computes to currentColor.

With automatic styling, the color’s visual effect is browser-dependent. Legacy invert was removed. Specification inclusion does not establish support in the target browser.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>outline-color</title>
<style>
  .sample {
    margin: 24px;
    padding: 12px;
    outline-style: solid;
    outline-width: 3px;
    outline-color: #005fcc;
  }
</style>
<div class="sample">Outline example</div>
</html>

Result

The box containing “Outline example” has a solid 3px outline colored #005fcc.

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources