1.两种盒模型分别说一下
ie盒模型和w3c盒模型
(content)、填充(padding)、边界(margin)、 边框(border);
IE的content部分把 border 和 padding计算了进去;
box-sizing:content-box(W3C)
box-sizing:border-box(IE)
我一般用border-box
2.如何垂直居中
table自带功能
position+margin-top
position+margin-top+transform: translate
display: flex; justify-content: center; align-items: center;
3.flex怎么用和常用属性
1 display:flex;属性
.box{
display: -webkit-flex; /* Safari或者chrome*/
display: flex;}
Flex布局以后,子元素的float
clear
vertical-align
-webkit-
-webkit-低版本写法。
2 flex-direction属性
flex-direction
.box {
flex-direction: row | row-reverse | column | column-reverse;}
3 flex-wrap属性
”轴线”)上, 不换行。flex-wrap
, 以及换行方式
.box{
flex-wrap: nowrap | wrap | wrap-reverse;}
4 justify-content属性
justify-content
.box {
justify-content: flex-start | flex-end | center | space-between | space-around;}
5 align-items属性
align-items
.box {
align-items: flex-start | flex-end | center | baseline | stretch;}