Skip to content

Commit ddc619b

Browse files
authored
Update solution.md
1 parent 880659f commit ddc619b

File tree

1 file changed

+1
-1
lines changed
  • 2-ui/1-document/09-size-and-scroll/6-width-vs-clientwidth

1 file changed

+1
-1
lines changed

2-ui/1-document/09-size-and-scroll/6-width-vs-clientwidth/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ Differences:
22

33
1. `clientWidth` is numeric, while `getComputedStyle(elem).width` returns a string with `px` at the end.
44
2. `getComputedStyle` may return non-numeric width like `"auto"` for an inline element.
5-
3. `clientWidth` is the inner content area of the element plus paddings, while CSS width (with standard `box-sizing`) is the inner conand sometent area *without paddings*.
5+
3. `clientWidth` is the inner content area of the element plus paddings, while CSS width (with standard `box-sizing`) is the inner content area *without paddings*.
66
4. If there's a scrollbar and the browser reserves the space for it, some browser substract that space from CSS width (cause it's not available for content any more), and some do not. The `clientWidth` property is always the same: scrollbar size is substracted if reserved.

0 commit comments

Comments
 (0)