Skip to content

Commit 0693ff9

Browse files
authored
fix: typo in 元素大小和滚动
1 parent 72e0a6b commit 0693ff9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function isHidden(elem) {
154154

155155
在上图中,我们首先考虑 `clientHeight`
156156

157-
这里没有水平滚动条,所以它恰好是 border 内的总和:CSS-width `200px` 加上顶部和底部的 padding(`2 * 20px`),总计 `240px`
157+
这里没有水平滚动条,所以它恰好是 border 内的总和:CSS-height `200px` 加上顶部和底部的 padding(`2 * 20px`),总计 `240px`
158158

159159
现在 `clientWidth` — 这里的 "content width" 不是 `300px`,而是 `284px`,因为被滚动条占用了 `16px`。所以加起来就是 `284px` 加上左侧和右侧的 padding,总计 `324px`
160160

0 commit comments

Comments
 (0)