transition-property
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2015ë 9ì.
transition-property CSS ìì±ì transition effect ì ì ì©í´ì¼ íë CSS ìì±ì ëª
ìí©ëë¤.
ìëí´ ë³´ê¸°
transition-property: margin-right;
transition-property: margin-right, color;
transition-property: all;
transition-property: none;
<section id="default-example">
<div id="example-element">Hover to see<br />the transition.</div>
</section>
#example-element {
background-color: #e4f0f5;
color: #000;
padding: 1rem;
border-radius: 0.5rem;
font: 1em monospace;
width: 100%;
transition: margin-right 2s;
}
#default-example:hover > #example-element {
background-color: #909;
color: #fff;
margin-right: 40%;
}
ë¨ì¶ ìì±ì ì§ì íë©´ (e.g., background), ì ëë©ì´ì
ê°ë¥í 모ë ì¸ë¶ ìì±ì´ ì§ì ë©ëë¤.
구문
/* Keyword values */
transition-property: none;
transition-property: all;
/* <custom-ident> values */
transition-property: test_05;
transition-property: -specific;
transition-property: sliding-vertically;
/* Multiple values */
transition-property: test1, animation4;
transition-property: all, height, color;
transition-property:
all,
-moz-specific,
sliding;
/* Global values */
transition-property: inherit;
transition-property: initial;
transition-property: revert;
transition-property: revert-layer;
transition-property: unset;
ê°
none-
ì´ë¤ ìì±ë í¸ëì§ì ëì§ ììµëë¤.
all-
í¸ëì§ì ê°ë¥í 모ë ìì±ì í¸ëì§ì ë©ëë¤.
<custom-ident>-
ê°ì´ ë³ê²½ë ë í¸ëì§ì í¨ê³¼ë¥¼ ì ì©í ìì±ì ìë³íë 문ìì´ì ëë¤.
íì ì ì
| ì´ê¸°ê° | all |
|---|---|
| ì ì©ëì | all elements, ::before and ::after pseudo-elements |
| ìì | no |
| ê³ì° ê° | as specified |
| Animation type | Not animatable |
íì 구문
transition-property =
none |
<single-transition-property>#
<single-transition-property> =
all |
<custom-ident>
ìì
>기본 ìì
ë²í¼ì í¸ë²íê±°ë í¬ì»¤ì±íë©´, 1ì´ ëì ììì´ í¸ëì§ì
ë©ëë¤. ì¬ê¸°ì transition-propertyë background-colorì
ëë¤.
HTML
<button class="target">Focus me!</button>
CSS
.target {
transition-property: background-color;
transition-duration: 1s;
background-color: #ccc;
}
.target:hover,
.target:focus {
background-color: #eee;
}
ë ë§ì transition-property ìì ë Using CSS transitionsìì íì¸í ì ììµëë¤.
ëª ì¸ì
| Specification |
|---|
| CSS Transitions Module Level 1 > # transition-property-property > |