outline
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2023ë 3ì.
CSS outline ë¨ì¶ ìì±ì 모ë ì¸ê³½ì ìì±ì í꺼ë²ì ì§ì í©ëë¤.
ìëí´ ë³´ê¸°
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ì ë¨ì¶ ìì±ì¼ë¡ì ë¤ìì íì ìì±ì í¬í¨í©ëë¤.
구문
/* 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:
|
| Animation type | as 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>
ìì
>ì¸ê³½ì ì¼ë¡ í¬ì»¤ì¤ ì¤íì¼ ì¤ì
HTML
<a href="#">This link has a special focus style.</a>
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 > |