From 3382aad40019bc130174bcfecea68884bc4922a2 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Tue, 1 Mar 2022 00:28:03 +0900 Subject: 2022/01/25 時点の英語版に同期 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/ja/web/api/element/clientleft/index.md | 115 ++++++++++++--------------- files/ja/web/api/element/clienttop/index.md | 104 ++++++++++++++++-------- 2 files changed, 123 insertions(+), 96 deletions(-) (limited to 'files/ja/web/api') diff --git a/files/ja/web/api/element/clientleft/index.md b/files/ja/web/api/element/clientleft/index.md index 7a17600640..0f7ccf8fb9 100644 --- a/files/ja/web/api/element/clientleft/index.md +++ b/files/ja/web/api/element/clientleft/index.md @@ -2,85 +2,72 @@ title: Element.clientLeft slug: Web/API/Element/clientLeft tags: -- API -- CSSOM View -- NeedsAgnostify -- NeedsMarkupWork -- Property -- Reference + - API + - CSSOM View + - NeedsAgnostify + - NeedsMarkupWork + - プロパティ + - リファレンス browser-compat: api.Element.clientLeft translation_of: Web/API/Element/clientLeft --- -
{{ APIRef("DOM") }}
+{{ APIRef("DOM") }} -

要素の左境界の幅をピクセル数で表します。これは、要素の書字方向が右書きで、オーバーフローがある場合、左の垂直スクロールバーがレンダリングされると垂直スクロールバーの幅を含みます。 clientLeft は、左マージンまたは左パディングを含みません。 clientLeft は読み取り専用です。

+要素の左境界の幅をピクセル数で表します。これは、要素の書字方向が右書きで、オーバーフローがある場合、左の垂直スクロールバーがレンダリングされると垂直スクロールバーの幅を含みます。 `clientLeft` は、左マージンまたは左パディングを含みません。 `clientLeft` は読み取り専用です。 -

layout.scrollbar.side 設定項目が 1 または 3 に設定されており、書字方向が RTL に設定されている場合、垂直スクロールバーは左側に配置され、これが clientLeft の計算方法に影響します。

+> **Note:** このプロパティは値を整数に丸めます。小数の値が必要な場合は、 {{ domxref("element.getBoundingClientRect()") }} を使用してください。 -
-

注: このプロパティは値を整数に丸めます。小数の値が必要な場合は、 {{ domxref("element.getBoundingClientRect()") }} を使用してください。 -

-
+> **Note:** 要素に `display: inline` が設定されている場合、境界の幅に関わらず `clientLeft` は `0` を返します。 -

+## 構文 -
-

注: 要素に - display: inline が設定されている場合、境界の幅に関わらず clientLeft0 を返します。

-
+```js +var left = element.clientLeft; +``` + +## 例 + +次の例では、クライアント領域の背景が白で、 `border-left` が 24px の黒になっています。 `clientLeft` の値は、マージン(黄色)領域の末端から、パディングとコンテンツ領域(白色)が始まるまでの距離、つまり 24px となります。 + +### HTML -

構文

- -
var left = element.clientLeft;
-
- -

- -
-
-

- padding-top

- -

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor - incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis - nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. -

- -

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in - culpa qui officia deserunt mollit anim id est laborum.

- -

- padding-bottom

-
- Left - Top - Right - Bottom - margin-top margin-bottom border-top border-bottom +```html +
+
+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor + incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis + nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

+
+``` -

仕様書

+### CSS -{{Specifications}} +```css + +#container { + margin: 3rem; + background-color: rgb(255, 255, 204); + border: 4px dashed black; +} -

ブラウザーの互換性

+#contained { + margin: 1rem; + border-left: 24px black solid; + padding: 0px 28px; + overflow: auto; + background-color: white; +} +``` -

{{Compat}}

+### 結果 -

+{{EmbedLiveSample("Example", 400, 350)}} -

clientLeft は MS IE DHTML オブジェクトモデルで最初に導入されました。

+## 仕様書 + +{{Specifications}} -

要素に設定された書字方向が右書きである場合の垂直スクロールバーの位置は、 layout.scrollbar.side の設定に依存します

+## ブラウザーの互換性 -

Gecko ベースのアプリケーションは、 clientLeft を Gecko 1.9 (Firefox 3、 {{ - Bug(111207) }} による実装) から実装しました。このプロパティは Firefox 2 以前では対応していません。

+{{Compat}} diff --git a/files/ja/web/api/element/clienttop/index.md b/files/ja/web/api/element/clienttop/index.md index 95ae5ad2b3..1438ca59a4 100644 --- a/files/ja/web/api/element/clienttop/index.md +++ b/files/ja/web/api/element/clienttop/index.md @@ -1,37 +1,77 @@ --- -title: element.clientTop +title: Element.clientTop slug: Web/API/Element/clientTop tags: - - DOM - - Gecko - - Gecko DOM Reference + - API + - CSSOM View + - NeedsAgnostify + - NeedsMarkupWork + - プロパティ + - リファレンス +browser-compat: api.Element.clientTop translation_of: Web/API/Element/clientTop --- -
- {{ApiRef}}
-

概要

-

要素の上ボーダーの幅のピクセル数です。上マージン、及び、上パディングは含みません。clientTop は読込専用です。

-

Gecko ベースアプリケーションは、 Gecko 1.9 (Firefox 3、{{Bug("111207")}} で実装) から clientTop をサポートします。このプロパティは、Firefox 2 以前ではサポートされません。

-

構文

-
top = element.clientTop;
-
-

-
-
-

padding-top

-

Gentle, individualistic and very loyal, Birman cats fall between Siamese and Persian in character. If you admire cats that are non aggressive, that enjoy being with humans and tend to be on the quiet side, you may well find that Birman cats are just the felines for you.

-

All Birmans have colorpointed features, dark coloration of the face, ears, legs and tail.

-

Cat image and text coming from www.best-cat-art.com

-

padding-bottom

-
- LeftTopRightBottommargin-topmargin-bottomborder-topborder-bottom{{mediawiki.external('if IE')}}><span id="MrgLeft" style="position: absolute; left: 8px; top: 65px; font: bold 13px Arial, sans-serif !important; writing-mode: tb-rl;">margin-left</span><span id="BrdLeft" style="position: absolute; left: 33px; top: 65px; color: white; font: bold 13px Arial, sans-serif !important; writing-mode: tb-rl;">border-left</span><span id="PdgLeft" style="position: absolute; left: 55px; top: 65px; font: bold 13px Arial, sans-serif !important; writing-mode: tb-rl;">padding-left</span><span id="PdgRight" style="position: absolute; left: 275px; top: 60px; color: black; font: bold 13px Arial, sans-serif !important; writing-mode: tb-rl; white-space: nowrap;">padding-right</span><span id="BrdRight" style="position: absolute; left: 310px; top: 65px; color: white; font: bold 13px Arial, sans-serif !important; writing-mode: tb-rl;">border-right</span><span id="MrgRight" style="position: absolute; left: 340px; top: 65px; font: bold 13px Arial, sans-serif !important; writing-mode: tb-rl;">margin-right</span><!{{mediawiki.external('endif')}}
-

-

仕様

-

W3C の仕様の一部ではありません。

-

注記

-

clientTop は MS IE DHTML オブジェクトモデルで最初に導入されました。

-

リファレンス

- +{{ APIRef("DOM") }} + +要素の上境界の幅をピクセル数で表します。これは要素の読み取り専用で整数型のプロパティです。 + +たまたま、 2 つの位置(`offsetTop` とクライアント領域の上端)の間にあるのは、要素の境界だけです。これは、 `offsetTop` が(マージンではなく)境界の上端の位置を示し、クライアント領域は境界の直下から始まるからです(クライアント領域はパディングを含みます)。したがって、 **clientTop** 値は常に "border-top-width" に対する `.getComputedStyle()` 値の整数部分と一致します。(実際には Math.round(parseFloat()) かもしれません。)例えば、計算された "border-top-width" が 0 の場合、 **`clientTop`** も 0 になります。 + +> **Note:** このプロパティは値を整数に丸めます。小数の値が必要な場合は、 {{ domxref("element.getBoundingClientRect()") }} を使用してください。 + +## 構文 + +```js +var top = element.clientTop; +``` + +## 例 + +次の例では、クライアント領域の背景が白で、 `border-top` が 24px の黒になっています。 `clientTop` の値は、マージン(黄色)領域の末端から、パディングとコンテンツ領域(白色)が始まるまでの距離、つまり 24px となります。 + +### HTML + +```html +
+
+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor + incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis + nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

+
+
+``` + +### CSS + +```css + +#container { + margin: 3rem; + background-color: rgb(255, 255, 204); + border: 4px dashed black; +} + +#contained { + margin: 1rem; + border-top: 24px black solid; + padding: 0px 28px; + overflow: auto; + background-color: white; +} +``` + +### 結果 + +{{EmbedLiveSample("Example", 400, 350)}} + +## メモ + +`clientTop` は MS IE DHTML オブジェクトモデルで最初に導入されました。 + +## 仕様書 + +{{Specifications}} + +## ブラウザーの互換性 + +{{Compat}} -- cgit v1.2.3-54-g00ecf