diff options
author | Masahiro FUJIMOTO <mfujimot@gmail.com> | 2022-01-02 20:00:34 +0900 |
---|---|---|
committer | Masahiro FUJIMOTO <mfujimot@gmail.com> | 2022-01-10 11:20:27 +0900 |
commit | 17cd5fb06a1e70c389225fbecf0a0cf29680855c (patch) | |
tree | b0abee660fe961b6c1847f376194470a1c61abed /files/ja/web/css/computed_value/index.md | |
parent | 94bf169537650fd99f4be40fecfded61d2d5ae00 (diff) | |
download | translated-content-17cd5fb06a1e70c389225fbecf0a0cf29680855c.tar.gz translated-content-17cd5fb06a1e70c389225fbecf0a0cf29680855c.tar.bz2 translated-content-17cd5fb06a1e70c389225fbecf0a0cf29680855c.zip |
CSS の主要概念の文書を変換準備
Diffstat (limited to 'files/ja/web/css/computed_value/index.md')
-rw-r--r-- | files/ja/web/css/computed_value/index.md | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/files/ja/web/css/computed_value/index.md b/files/ja/web/css/computed_value/index.md new file mode 100644 index 0000000000..f08509b8d0 --- /dev/null +++ b/files/ja/web/css/computed_value/index.md @@ -0,0 +1,59 @@ +--- +title: 計算値 +slug: Web/CSS/computed_value +tags: + - CSS + - Guide + - Reference + - リファレンス +translation_of: Web/CSS/computed_value +--- +<div>{{cssref}}</div> + +<p><span class="seoSummary"><a href="/ja/docs/Web/CSS">CSS</a> の プロパティの<ruby><strong>計算値</strong><rp> (</rp><rt>computed value</rt><rp>) </rp></ruby>は、継承の過程で親から子へ伝えられる値です。</span>これは<a href="/ja/docs/Web/CSS/specified_value">指定値</a>から計算されます。</p> + +<ol> + <li>特殊な値である {{cssxref("inherit")}}, {{cssxref("initial")}}, {{cssxref("unset")}}, {{cssxref("revert")}} を扱います。</li> + <li>プロパティの概要の「計算値」に記載された値に達するのに必要な計算を行います。</li> +</ol> + +<p>プロパティの計算値に達するのに必要な計算は、一般に (<code>em</code> の単位やパーセントなどの) 相対値を絶対値に変換する計算を含みます。例えば、ある要素に <code>font-size: 16px</code> と <code>padding-top: 2em</code> が指定された場合、 <code>padding-top</code> の計算値は <code>32px</code> (フォントサイズの倍) になります。</p> + +<p>しかしながら、いくつかのプロパティ (<code>width</code>, <code>margin-right</code>, <code>text-indent</code>, <code>top</code> など、レイアウトの定義に必要ものに対する割合が相対的なもの) でパーセント指定された値はパーセント計算された値に変わります。さらに、 <code>line-height</code> に指定された単位なしの値は、指定された計算値になります。これらの計算値に残った相対的な値は、<a href="/ja/docs/Web/CSS/used_value">使用値</a>が定義された場合、絶対値になります。</p> + +<div class="note"> +<p><strong>注:</strong> DOM の {{domxref("Window.getComputedStyle", "getComputedStyle()")}} API は<a href="/ja/docs/Web/CSS/resolved_value">解決値</a>を返しますが、これはプロパティによって<a href="/ja/docs/Web/CSS/computed_value">計算値</a>であるか<a href="/ja/docs/Web/CSS/used_value">使用値</a>であるかが変わります。</p> +</div> + +<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("CSS2.2", "cascade.html#computed-value", "computed-value")}}</td> + <td>{{Spec2("CSS2.2")}}</td> + <td> + <p>変更なし</p> + </td> + </tr> + <tr> + <td>{{SpecName("CSS2.1", "cascade.html#computed-value", "computed value")}}</td> + <td>{{Spec2("CSS2.1")}}</td> + <td>初回定義</td> + </tr> + </tbody> +</table> + +<h2 id="See_also" name="See_also">関連情報</h2> + +<ul> + <li>{{domxref("window.getComputedStyle")}}</li> + <li>{{CSS_key_concepts}}</li> +</ul> |