Skip to content

Commit f07d4a0

Browse files
authored
Merge pull request javascript-tutorial#787 from Ghost-017/patch-9
update
2 parents 19adf7c + 1591c82 commit f07d4a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

2-ui/1-document/11-coordinates/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Also:
4848

4949
- Coordinates may be decimal fractions. That's normal, internally browser uses them for calculations. We don't have to round them when setting to `style.position.left/top`, the browser is fine with fractions.
5050
- Coordinates may be negative. For instance, if the page is scrolled down and the top `elem` is now above the window. Then, `elem.getBoundingClientRect().top` is negative.
51-
- Some browsers (like Chrome) provide additional properties (`width` and `height`) to `getBoundingClientRect` as the result. We can also get them by subtraction: `height=bottom-top`, `width=right-left`.
51+
- Some browsers (like Chrome) provide additional properties, `width` and `height` of the element that invoked the method to `getBoundingClientRect` as the result. We can also get them by subtraction: `height=bottom-top`, `width=right-left`.
5252

5353
```warn header="Coordinates right/bottom are different from CSS properties"
5454
If we compare window coordinates versus CSS positioning, then there are obvious similarities to `position:fixed`. The positioning of an element is also relative to the viewport.

0 commit comments

Comments
 (0)