Skip to content

Commit 6ff71c4

Browse files
committed
[문서] 문서 1.8 ~ 1.11 병합충돌 해결
아래의 병합 충돌을 해결했습니다. - 1.8 스타일과 클래스 - 1.9 요소 사이즈와 스크롤 - 1.10 브라우저 창 사이즈와 스크롤 - 1.11 좌표
1 parent 71ab899 commit 6ff71c4

4 files changed

Lines changed: 14 additions & 123 deletions

File tree

2-ui/1-document/08-styles-and-classes/article.md

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -128,21 +128,16 @@ setTimeout(() => document.body.style.display = "", 1000); // 1초 후 다시 원
128128

129129
이렇게 `style.display`에 빈 문자열을 할당하면 브라우저는 마치 처음부터 `style.display` 프로퍼티가 없었던 것처럼 CSS 클래스와 브라우저 내장 스타일을 페이지에 적용합니다.
130130

131-
<<<<<<< HEAD
132-
````smart header="`style.cssText`로 완전히 다시 쓰기"
133-
개별 스타일 프로퍼티를 적용할 때는 보통 `style.*`를 사용합니다. 그런데 `div.style` 은 객체이고 읽기 전용이기 때문에 `div.style="color: red; width: 100px"`같은 방식으론 전체 스타일을 설정할 수 없습니다.
134-
=======
135-
Also there is a special method for that, `elem.style.removeProperty('style property')`. So, We can remove a property like this:
131+
이를 위한 특별한 메서드인 `elem.style.removeProperty('style property')`도 있습니다. 아래와 같이 프로퍼티를 제거할 수 있습니다.
136132

137-
```js run
138-
document.body.style.background = 'red'; //set background to red
133+
````js run
134+
document.body.style.background = 'red'; // 배경을 빨간색으로 설정
139135

140-
setTimeout(() => document.body.style.removeProperty('background'), 1000); // remove background after 1 second
141-
```
136+
setTimeout(() => document.body.style.removeProperty('background'), 1000); // 1초 후 배경 제거
137+
````
142138

143-
````smart header="Full rewrite with `style.cssText`"
144-
Normally, we use `style.*` to assign individual style properties. We can't set the full style like `div.style="color: red; width: 100px"`, because `div.style` is an object, and it's read-only.
145-
>>>>>>> upstream/master
139+
````smart header="`style.cssText`로 완전히 다시 쓰기"
140+
개별 스타일 프로퍼티를 적용할 때는 보통 `style.*`를 사용합니다. 그런데 `div.style` 은 객체이고 읽기 전용이기 때문에 `div.style="color: red; width: 100px"`같은 방식으론 전체 스타일을 설정할 수 없습니다.
146141

147142
문자열을 사용해 전체 스타일을 설정하려면 프로퍼티 `style.cssText`를 사용해야 합니다.
148143

@@ -273,7 +268,6 @@ pseudo
273268
````warn header="`getComputedStyle`엔 프로퍼티 전체 이름이 필요합니다."
274269
`getComputedStyle`을 사용할 때는 `paddingLeft`, `marginTop`, `borderTopWidth`같이 프로퍼티 이름 전체를 정확히 알고 있어야 합니다. 그렇지 않으면 원하는 값을 얻을 수 없는 경우가 생깁니다.
275270
276-
<<<<<<< HEAD
277271
`paddingLeft`나 `paddingTop`엔 값이 지정되어있는데 `getComputedStyle(elem).padding`을 사용해 값을 얻으려 하는 경우를 생각해 봅시다. 어떤 값을 얻을 수 있을까요? 아무것도 얻지 못할까요 아니면 값이 설정되어 있는 `paddingLeft`나 `paddingTop`에서 값을 가져올까요? 이런 상황에 적용할만한 표준은 아직 제정되어있지 않습니다.
278272
279273
따라서 브라우저마다 동작 방식이 다릅니다. Chrome 같은 몇몇 브라우저는 아래 예시와 같이 `10px`을 출력해주는데 Firefox에서 빈 문자열이 출력됩니다.
@@ -289,9 +283,6 @@ pseudo
289283
alert(style.margin); // Firefox에선 빈 문자열이 출력됩니다.
290284
</script>
291285
```
292-
=======
293-
For instance, if there are properties `paddingLeft/paddingTop`, then what should we get for `getComputedStyle(elem).padding`? Nothing, or maybe a "generated" value from known paddings? There's no standard rule here.
294-
>>>>>>> upstream/master
295286
````
296287

297288
```smart header="`:visited` 링크 관련 스타일은 숨겨져 있습니다."

2-ui/1-document/09-size-and-scroll/article.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,7 @@ CSS `position` 프로퍼티가 설정되어있는 조상 요소가 없는 경우
106106
107107
따라서 요소(혹은 이 요소의 조상 요소 중 어떤 것이든)의 CSS `display` 프로퍼티가 `none`이거나 문서 내에 해당 요소가 없으면 모든 기하 프로퍼티 값이 0이 됩니다(`offsetParent` 프로퍼티의 값은 `null`).
108108
109-
<<<<<<< HEAD
110109
요소를 만들긴 했지만 아직 문서에 삽입하기 전이라던가, 새롭게 만든 요소의 `display` 프로퍼티가 `none`이면 기하 프로퍼티 값은 0, `offsetParent` 프로퍼티의 값은 `null`이 되는 것이죠.
111-
=======
112-
For example, `offsetParent` is `null`, and `offsetWidth`, `offsetHeight` are `0` when we created an element, but haven't inserted it into the document yet, or it (or its ancestor) has `display:none`.
113-
>>>>>>> upstream/master
114110
115111
이런 특징을 이용하면 요소의 숨김 상태 여부를 아래 같은 방법으로 확인할 수 있습니다.
116112
@@ -120,11 +116,7 @@ function isHidden(elem) {
120116
}
121117
```
122118
123-
<<<<<<< HEAD
124119
참고로 `isHidden`은 요소가 화면에 있긴 하지만 사이즈가 0일 때(비어있는 `<div>` 등)도 `true`를 반환하기 때문에 주의해서 사용해야 합니다.
125-
=======
126-
Please note that such `isHidden` returns `true` for elements that are on-screen, but have zero sizes.
127-
>>>>>>> upstream/master
128120
````
129121

130122
## clientTop과 clientLeft

0 commit comments

Comments
 (0)