Movatterモバイル変換


[0]ホーム

URL:


  1. 개발자를 위한 웹 기술
  2. CSS
  3. CSS 참고서
  4. Values
  5. unset

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

View in EnglishAlways switch to English

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 단축 속성을 포함한 모든 속성에 사용할 수 있습니다.

예제

글자 색

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

브라우저 호환성

같이 보기

  • initial을 사용해 속성의 초깃값을 사용하세요.
  • revert를 사용해 사용자 에이전트가 지정한 값(또는 사용자가 수정한 값)으로 속성을 되돌리세요.
  • inherit을 사용해 속성의 값이 부모와 같도록 지정하세요.
  • all 속성을 사용하면 요소의 모든 속성을 한꺼번에initial,inherit,revert,unset할 수 있습니다.

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp