You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 2-ui/1-document/09-size-and-scroll/article.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,9 +63,9 @@ That's the nearest ancestor that is one of the following:
63
63
2. `<td>`, `<th>`, or `<table>`, or
64
64
3. `<body>`.
65
65
66
-
Properties `offsetLeft/offsetTop` provide x/y coordinates relative to `offsetParent` upper-left corner.
66
+
Properties `offsetLeft/offsetTop` provide x/y coordinates of the element's upper-left corner relative to its `offsetParent`.
67
67
68
-
In the example below the inner `<div>` has `<main>` as `offsetParent` and `offsetLeft/offsetTop` shifts from its upper-left corner (`180`):
68
+
In the example below, the inner `<div>` has `<main>` as `offsetParent`, and `offsetLeft/offsetTop` are the offsets of its upper-left corner (`180`) relative to the `offsetParent`:
69
69
70
70
```html run height=10
71
71
<main style="position: relative" id="main">
@@ -266,7 +266,7 @@ Please note that the described difference is only about reading `getComputedStyl
266
266
Elements have the following geometry properties:
267
267
268
268
- `offsetParent` -- is the nearest positioned ancestor or `td`, `th`, `table`, `body`.
269
-
- `offsetLeft/offsetTop` -- coordinates relative to the upper-left edge of `offsetParent`.
269
+
- `offsetLeft/offsetTop` -- coordinates of the upper-left corner relative to the `offsetParent`.
270
270
- `offsetWidth/offsetHeight` -- "outer" width/height of an element including borders.
271
271
- `clientLeft/clientTop` -- the distances from the upper-left outer corner to the upper-left inner (content + padding) corner. For left-to-right OS they are always the widths of left/top borders. For right-to-left OS the vertical scrollbar is on the left so `clientLeft` includes its width too.
272
272
- `clientWidth/clientHeight` -- the width/height of the content including paddings, but without the scrollbar.
0 commit comments