-
Notifications
You must be signed in to change notification settings - Fork 39
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 layout和Flex布局? #132
Comments
CSS layout存在的意义是什么?Place your boxes in the right place in relation to the viewport CSS layout包含哪些东西?
|
display
|
Normal FlowNormal Flow也可以理解为document flow(文档流)。
css盒模型细节是怎样的?独立的一个元素盒子,先由content占据内容,然后再添加padding,border和margin。 individual元素默认是怎么布局的?
elements interact with one another的如何布局?
一个清晰解释writing-mode属性的例子这个例子对于理解normal flow(标准流)非常有用。 <div style="writing-mode: horizontal-tb;">
<div>
<span>foo</span>
<span>bar</span>
<span>baz</span>
</div>
<div>2</div>
<div>3</div>
<div>4</div>
</div>
既然是行内元素,标签可以写在一行吗?不行。 一张理解Normal Flow的图 |
Flexbox
display:inline-flex属性怎么用?
基于demo:https://mdn.github.io/learning-area/css/css-layout/flexbox/flexbox0.html <section>
<article>...</article>
<article>...</article>
<article>...</article>
</section> section {
display: inline-flex; // or flex
width: 50%;
}
由此我们可以得出结论: 评论: 弹性盒模型图
如何控制flex container内的flex item的排列方向?这个方向其实就是main axis,默认是row。 flex-direction: column; 还可以是row-reverse,column-reverse这两个反过来的排列。 flex container 宽度限定,怎么解决flex items会overflow出去的问题?很简单。 如何理解flex:200px?
有没有整合了flex-direction和flex-wrap的缩写属性?flex-direction: row;
flex-wrap: wrap; =》 如何调整flex item的占比?flex:1;
flex:2;
flex:3;
|
css-tricks的flex指南细读css-tricks flex文章: A Complete Guide to Flexbox
参考资料: |
The text was updated successfully, but these errors were encountered: