Skip to content

Commit f8d3362

Browse files
boyeonihnViolet-Bora-Lee
authored andcommitted
[신규 번역] Part 2. 2.9 Element size and scrolling 마지막 (difference: CSS width versus clientWidth) 과제 및 해답 번역 (#1535)
1 parent 5930fc9 commit f8d3362

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Differences:
1+
둘의 차이점은 다음과 같습니다.
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`는 숫자형을 반환하는 반면, `getComputedStyle(elem).width`는 끝에 `px`가 붙은 문자열을 반환합니다.
4+
2. `getComputedStyle`은 인라인 요소의 너비를 구할 때 `"auto"`와 같은 숫자가 아닌 값을 반환할 수도 있습니다.
5+
3. `clientWidth`는 콘텐츠와 패딩을 포함한 영역의 너비를 가르키지만, (표준 `box-sizing`과 연관된) CSS `width`*패딩을 제외한* 콘텐츠 영역의 너비를 가리킵니다.
6+
4. 페이지에 스크롤바가 있고 브라우저가 스크롤바 영역을 따로 처리하는 경우에, 어떤 브라우저는 CSS width를 계산할 때 스크롤바 너비를 제외하는 반면(스크롤바 영역은 콘텐츠를 담을 수 없기 때문) 어떤 브라우저는 스크롤바 영역을 포함합니다. `clientWidth` 프로퍼티는 브라우저 종류에 상관 없이 항상 동일하게 스크롤바 영역이 있는 경우엔 스크롤바 너비를 제외합니다.

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

+3-3
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+
# CSS width와 clientWidth의 차이
66

7-
What's the difference between `getComputedStyle(elem).width` and `elem.clientWidth`?
7+
`getComputedStyle(elem).width``elem.clientWidth`의 차이점은 무엇일까요?
88

9-
Give at least 3 differences. The more the better.
9+
최소 세 가지 차이점을 설명해주세요. 더 많을수록 좋습니다.

0 commit comments

Comments
 (0)