aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/element/clientheight/index.html
blob: 4cde36518da6cdd226f2af2151461c579f60ba50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
title: Element.clientHeight
slug: Web/API/Element/clientHeight
tags:
  - API
  - CSSOM View
  - NeedsMarkupWork
  - Property
  - Reference
translation_of: Web/API/Element/clientHeight
---
<div>{{APIRef("DOM")}}</div>

<p><strong><code>Element.clientHeight</code></strong> は読み取り専用のプロパティで、 CSS のない要素やインラインレイアウトボックスではゼロになります。それ以外では、要素の内側の寸法をピクセル単位で表します。パディングは含みますが、境界、マージン、 (もしあれば) 水平スクロールバーは含みません。</p>

<p><code>clientHeight</code> は CSS <code>height</code> + CSS <code>padding</code> - 水平スクロールバーの高さ(height) (もしあれば) として計算できます。</p>

<p><code>clientHeight</code> がルート要素 (<code>&lt;html&gt;</code> 要素) (または文書が後方互換モードである場合は <code>&lt;body&gt;</code>) に使用された場合、 (スクロールバーを除いた) ビューポートの高さが返されます。<a href="https://www.w3.org/TR/2016/WD-cssom-view-1-20160317/#dom-element-clientheight">これは <code>clientHeight</code> の特例です</a></p>

<div class="note">
<p><strong>注:</strong> このプロパティは値を整数値に丸めます。小数値が必要であれば、 {{ domxref("element.getBoundingClientRect()") }} を使用してください。</p>
</div>

<h2 id="Syntax" name="Syntax">構文</h2>

<pre class="syntaxbox notranslate">var <var>intElemClientHeight</var> = <var>element</var>.clientHeight;</pre>

<p><code><var>intElemClientHeight</var></code><code><var>element</var></code><code>clientHeight</code> をピクセル単位で表す整数値です。 <code>clientHeight</code> プロパティは読み取り専用です。</p>

<h2 id="Example" name="Example"></h2>

<p><img alt="Image:Dimensions-client.png" class="internal" src="/@api/deki/files/185/=Dimensions-client.png"></p>

<h2 id="Specification" name="Specification">仕様書</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('CSSOM View', '#dom-element-clientheight', 'clientHeight')}}</td>
   <td>{{Spec2("CSSOM View")}}</td>
   <td></td>
  </tr>
 </tbody>
</table>

<h3 id="Notes" name="Notes"></h3>

<p><code>clientHeight</code> は Internet Explorer オブジェクトモデルで導入されたプロパティです。</p>

<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>

<p>{{Compat("api.Element.clientHeight")}}</p>

<h2 id="See_also" name="See_also">関連情報</h2>

<ul>
 <li>{{domxref("HTMLElement.offsetHeight")}}</li>
 <li>{{domxref("Element.scrollHeight")}}</li>
 <li><a href="/ja/docs/Web/API/CSS_Object_Model/Determining_the_dimensions_of_elements">要素の寸法の決定</a></li>
</ul>