Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

css的position属性有哪些取值,它们的行为是什么? #29

Open
FredWe opened this issue Apr 21, 2015 · 0 comments
Open

css的position属性有哪些取值,它们的行为是什么? #29

FredWe opened this issue Apr 21, 2015 · 0 comments

Comments

@FredWe
Copy link
Owner

FredWe commented Apr 21, 2015

来源于@wintercn的一道面试题:

css的position属性有哪些取值,它们的行为是什么?

这个题目几乎是我每次必问的,因为这个题区分度、深度和覆盖范围都很高。这个题的答案可以分成不同的层级:

position属性常用的取值static、relative以及absolute和它们的基本行为是每个前端都应该掌握的。这包括relative和absolute的定位原点。
fixed旧版本IE不支持,但是一个对技术有热情的工程师也是应该了解的。
有过研究工程师可以知道absolute的containing block计算方式跟正常流不同,当然如果没读过标准的话,表述方式不一定是这样。
对CSS布局有深入研究的工程师会知道position跟display、margin collapse、overflow、float这些特性相互叠加后的行为。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant