Skip to content

Commit 7a50345

Browse files
committed
Update 2-ui\1-document\09-size-and-scroll\tasks
1 parent 42675cf commit 7a50345

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Differences:
1+
Differenze:
22

3-
1. `clientWidth` is numeric, while `getComputedStyle(elem).width` returns a string with `px` at the end.
4-
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 content area *without paddings*.
6-
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.
3+
1. `clientWidth` è un valore numerico, `getComputedStyle(elem).width` invece restituisce una stringa con `px` alla fine.
4+
2. `getComputedStyle` può restituire una larghezza non numerica come `"auto"` per un elemento inline.
5+
3. `clientWidth` è l'area del contenuto interna di un elemento più i padding, mentre la proprietà width dei CSS (con il valore predefinito di `box-sizing`) è l'area del contenuto interna *senza i padding*.
6+
4. Se c'è una barra di scorrimento ed il browser le riserva uno spazio, alcuni browser sottraggono quello spazio dalla larghezza impostata tramite CSS (perché non è più disponibile per i contenuti), e altri invece no. La proprietà `clientWidth` è sempre la stessa: se la barra di scorrimento ha uno spazio riservato viene sottratto all'area del contenuto.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ importance: 5
22

33
---
44

5-
# The difference: CSS width versus clientWidth
5+
# Indica le differenze tra la proprietà width CSS e clientWidth
66

7-
What's the difference between `getComputedStyle(elem).width` and `elem.clientWidth`?
7+
Quali sono le differenze tra `getComputedStyle(elem).width` e `elem.clientWidth`?
88

9-
Give at least 3 differences. The more the better.
9+
Indica almeno 3 differenze. Più sono meglio è.

0 commit comments

Comments
 (0)