Last active
September 8, 2017 08:07
-
-
Save dailc/93e5393af2662ab4d8af27a9965ca2d2 to your computer and use it in GitHub Desktop.
[overflow的使用] overflow的使用 #tags: overflow, BFC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## BFC | |
除了visible外,其它值都会触发BFC,去除浮动影响 | |
## overflow:scroll 与 overflow:auto | |
__scroll__ | |
始终显示滚动条 | |
内容自动撑开,容器的宽度不包括滚动条,相当于滚动条是一个和内容并列显示的组件 | |
__auto__ | |
按需决定是否显示滚动条 | |
内容撑开时,容器的宽度包括滚动条,即使用`whitespace: no-wrap;`撑开容器至正好显示所有内容时,如果有滚动条滚动条会覆盖在内容上方,导致内容宽度再次被缩小,然后出现省略号。 | |
推测的渲染顺序: | |
```js | |
自适应宽度 → 根据高度显示滚动条 → 重新计算内部元素宽度 | |
``` | |
http://www.jianshu.com/p/1ac2933891cd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment