[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/CSS/Reference/Properties/outline [Back]  [Original]

outline - CSS: Cascading Style Sheets | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

outline

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2023 3.

CSS outline .

In this article

outline: solid;
outline: dashed red;
outline: 1rem solid;
outline: thick double #32a1ce;
outline: 8px ridge rgba(170, 50, 220, 0.6);
border-radius: 2rem;
<section class="default-example" id="default-example">
  <div class="transition-all" id="example-element">
    This is a box with an outline around it.
  </div>
</section>
#example-element {
  padding: 0.75rem;
  width: 80%;
  height: 100px;
}

outline .

css
/* style */
outline: solid;

/* color | style */
outline: #f66 dashed;

/* style | width */
outline: inset thick;

/* color | style | width */
outline: green solid 3px;

/*   */
outline: inherit;
outline: initial;
outline: unset;

outline .

: . none , <input> .

<'outline-color'>

. currentcolor. outline-color .

<'outline-style'>

. none. outline-style .

<'outline-width'>

. medium. outline-width .

, .

  • .
  • . .

, .

outline 0 none . . .

as each of the properties of the shorthand:
all elements
no
as each of the properties of the shorthand:
  • outline-width: the absolute <length>, snapped as a line width
  • outline-style: as specified
  • outline-color: For the keyword auto, the computed value is currentcolor. For the color value, if the value is translucent, the computed value will be the rgba() corresponding one. If it isn't, it will be the rgb() corresponding one. The transparent keyword maps to rgba(0,0,0,0).
Animation typeas each of the properties of the shorthand:

outline = 
<'outline-width'> ||
<'outline-style'> ||
<'outline-color'>

<outline-width> =
<line-width>

<outline-style> =
auto |
<outline-line-style>

<outline-color> =
auto |
<'border-top-color'>

<line-width> =
<length [0,]> |
hairline |
thin |
medium |
thick

<outline-line-style> =
none |
auto |
dotted |
dashed |
solid |
double |
groove |
ridge |
inset |
outset

<border-top-color> =
<color> |
<image-1D>

<image-1D> =
<stripes()>

<stripes()> =
stripes( <color-stripe># )

<color-stripe> =
<color> &&
[ <length-percentage> | <flex> ]?

<length-percentage> =
<length> |
<percentage>
CSS Basic User Interface Module Level 4, CSS Borders and Box Decorations Module Level 4, CSS Images Module Level 4, CSS Values and Units Module Level 4 . . .

HTML

html
<a href="#">This link has a special focus style.</a>

CSS

css
a {
  border: 1px solid;
  border-radius: 3px;
  display: inline-block;
  margin: 10px;
  padding: 5px;
}

a:focus {
  outline: 4px dotted #e73;
  outline-offset: 4px;
  background: #ffa;
}

Specification
CSS Basic User Interface Module Level 4
# outline


Web Proxy Viewer  |  New URL  |  Original Page