Help us understand the problem. What is going on with this article?

CSS allプロパティについて

More than 3 years have passed since last update.

allはすべてのプロパティ(unicode-bidi,directionを除く)に対して値の扱いを指定できるプロパティ

使えるキーワード(値)は3つあります

1. all: initial;

要素に指定、親要素から継承しているプロパティの値を初期値にする

2. all: inherit;

親要素に指定してあるすべてのプロパティの値を継承します
(通常継承されない値も継承する)

サンプル

sample.png
※親要素が45度回転 その子要素がさらに45度回転した状態

<div class="parent"></div>
.parent{
  width: 100px;
  height: 100px;

  border: 1px solid blue;

  transform: rotate(45deg)
}

.parent:before{
  content: "";
  all: inherit;

  /* allのあとに記述することで上書きできる */
  border: 1px dotted red;
}

3. all: unset;

その要素に設定されたプロパティは全て初期値に戻し親要素から継承されるプロパティはそのまま継承されます。

ただし通常継承されないプロパティは継承されません。

引用: all - CSS | MDN

対応ブラウザ

http://caniuse.com/#search=all

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away