This page was translated from English by the community.Learn more and join the MDN Web Docs community.
unset
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2016년 3월.
CSSunset 키워드를 적용한 속성은, 부모로부터 상속할 값이 존재하면 상속값을, 그렇지 않다면초깃값을 사용합니다. 다르게 표현하자면, 전자일 땐inherit 키워드처럼, 후자일 땐initial 키워드처럼 동작합니다.all 단축 속성을 포함한 모든 속성에 사용할 수 있습니다.
In this article
예제
>글자 색
HTML
html
<p>This text is red.</p><div> <p>This text is also red.</p></div><div> <p>This text is green (default inherited value).</p></div>CSS
css
.foo { color: blue;}.bar { color: green;}p { color: red;}.bar p { color: unset;}결과
테두리
HTML
html
<p>This text has a red border.</p><div> <p>This text has a red border.</p></div><div> <p>This text has has a black border (initial default, not inherited).</p></div>CSS
css
div { border: 1px solid green;}p { border: 1px solid red;}.bar p { border-color: unset;}결과
명세
| Specification |
|---|
| CSS Cascading and Inheritance Level 4> # inherit-initial> |