前端面试-汇总
一,css部分,大致可以问的几处地方 盒模型 组成 content+ border + padding + margin 标准盒模型(用box-sizing:content-box;),IE模型(box-size: border-box) 垂直居中方法(方法太多了,随便举几个) 1.display: flex; 2. position:absolute; 3, transform 三栏布局 (放几个常见的) float flex position 选择器权重计算方式 id > class > 标签选择器 行内样式 > 内联 > 外部链接 important 优先级最高 清除浮动的方法 外层div上加 overflow:hidden 外层div 上加:after 伪类 .clearfix:after{/*伪元素是行内元素 正常浏览器清除浮动方法*/ content: ""; display: block; height: 0; clear:both; visibility: hidden; } .clearfix{ *zoom: 1; } 使用before和after双伪元素清除浮动 display: table, content: ' ', clear: both 末尾加div clear:both flex 这个布局讲起来太多东西了,值得仔细研究 ( http: