aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/css/inherit/index.md
diff options
context:
space:
mode:
Diffstat (limited to 'files/ja/web/css/inherit/index.md')
-rw-r--r--files/ja/web/css/inherit/index.md85
1 files changed, 85 insertions, 0 deletions
diff --git a/files/ja/web/css/inherit/index.md b/files/ja/web/css/inherit/index.md
new file mode 100644
index 0000000000..25f700decc
--- /dev/null
+++ b/files/ja/web/css/inherit/index.md
@@ -0,0 +1,85 @@
+---
+title: inherit
+slug: Web/CSS/inherit
+tags:
+ - CSS
+ - CSS カスケードと継承
+ - CSS 値
+ - Cascade
+ - Inheritance
+ - Layout
+ - Reference
+ - inherit
+ - カスケード
+ - スタイル
+ - 継承
+translation_of: Web/CSS/inherit
+---
+<div>{{CSSRef}}</div>
+
+<p><span class="seoSummary"><strong><code>inherit</code></strong> は CSS のキーワードで、要素のプロパティの<a href="/ja/docs/Web/CSS/computed_value">計算値</a>を親要素から取得するよう指定します。</span> CSS の一括指定 {{cssxref("all")}} を含め、すべての CSS プロパティに適用することができます。</p>
+
+<p><a href="/ja/docs/Web/CSS/inheritance#Inherited_properties">継承プロパティ</a>においては、既定の動作を推進するものであり、他の規則を上書きする場合にのみ必要です。<a href="/ja/docs/Web/CSS/inheritance#Non-inherited_properties">非継承プロパティ</a>においては、比較的意味の弱い動作をしますので、 {{cssxref("all")}} プロパティには {{cssxref("initial")}} , {{cssxref("unset")}} などを使用した方が良いかもしれません。</p>
+
+<p>親要素が包含ブロックではなかった場合であっても、常に文書ツリー内の親要素から継承が行われます。</p>
+
+<h2 id="Example" name="Example">例</h2>
+
+<pre class="brush: css notranslate">/* 第二レベルのヘッダーを緑色にする */
+h2 { color: green; }
+
+/* ... ただしサイドバーの中にあるものは、親要素の色を使用する */
+#sidebar h2 { color: inherit; }
+</pre>
+
+<p>この例の中で、サイドバー内にある <code>h2</code> 要素は異なる色になる可能性があります。例えば、以下の規則に一致する div の子であった場合は ...</p>
+
+<pre class="brush: css notranslate">div#current { color: blue; }
+</pre>
+
+<p>... 青になるでしょう。</p>
+
+<h2 id="Specifications" name="Specifications">仕様書</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">仕様書</th>
+ <th scope="col">状態</th>
+ <th scope="col">備考</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{ SpecName('CSS4 Cascade', '#inherit', 'inherit') }}</td>
+ <td>{{Spec2('CSS4 Cascade')}}</td>
+ <td> Level 3 から変更なし。</td>
+ </tr>
+ <tr>
+ <td>{{ SpecName('CSS3 Values', "#common-keywords", "inherit") }}</td>
+ <td>{{ Spec2('CSS3 Values') }}</td>
+ <td> {{ SpecName('CSS2.1') }} から重要な変更なし。</td>
+ </tr>
+ <tr>
+ <td>{{ SpecName('CSS2.1', "cascade.html#value-def-inherit", "inherit") }}</td>
+ <td>{{ Spec2('CSS2.1') }}</td>
+ <td>初回定義。</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>
+
+<div>
+<p>{{Compat("css.types.global_keywords.inherit")}}</p>
+</div>
+
+<h2 id="See_Also" name="See_Also">関連情報</h2>
+
+<ul>
+ <li><a class="internal" href="/ja/docs/Web/CSS/inheritance">継承</a></li>
+ <li>{{cssxref("initial")}} を使用すると、プロパティを初期値に設定します。</li>
+ <li>{{cssxref("unset")}} を使用すると、継承プロパティは継承値に、それ以外は初期値に設定します。</li>
+ <li>{{cssxref("revert")}} を使用すると、プロパティをユーザーエージェントのスタイルシート (又はもしあれば、ユーザーのスタイル) で設定された値に初期化します。</li>
+ <li>{{cssxref("all")}} プロパティは、すべてのプロパティを一度に initial, inherit, revert, unset の状態にします。</li>
+</ul>