CSS BFC in depth

BFC (Block Formatting Context)

https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context

clearfix & clear float

  1. clear: both;

  2. overflow: auto;

margin collapsing

https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing

margin 合并后, margin 大小的计算方法

++, max +

--, min -

+-, sum

同为正数,取大的正值(正)

Math.max(10px, 20px) = 20px

同为负数,取小的负值(负)

Math.min(-10px, -20px) = -20px

一正一负,取求和后的值(可正可负)

10px + -20px = -10px

BFC 触发条件

CSS box modal

统一使用 box-sizing: border-box;

CSS 盒子模型

https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Introduction_to_the_CSS_box_model

https://css-tricks.com/the-css-box-model/

IE 盒子模型 的 content 包括 border、padding

refs

CSS margin collapsing All In One

https://www.cnblogs.com/xgqfrms/p/13643081.html

https://www.smashingmagazine.com/2017/12/understanding-css-layout-block-formatting-context/

site:css-tricks.com BFC

https://css-tricks.com/almanac/properties/d/display/

https://css-tricks.com/handling-long-unexpected-content-css/

https://www.cssmojo.com/block-formatting-contexts/

https://www.zhangxinxu.com/wordpress/2015/02/css-deep-understand-flow-bfc-column-two-auto-layout/

https://www.w3cplus.com/css/understanding-css-layout-block-formatting-context.html

https://segmentfault.com/a/1190000013023485



xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


最新文章

  1. AWS S3 CLI的权限bug
  2. SQL中的连接可以分为内连接,外连接,以及交叉连接 。
  3. [转]使用CSS3实现树形控件
  4. fill 函数
  5. 牛客OJ——[编程题]A+B和C__如何输入多组测试数据(测试OK)
  6. Apache服务
  7. 关于android app两次点击返回键退出的处理
  8. shuffle机制和TextInputFormat分片和读取分片数据(九)
  9. android4.0 禁止横竖屏切换使用 android:configChanges="orientation|keyboardHidden"无效
  10. PHP学习笔记8-文件操作
  11. maven配置全局的jdk和配置局部的jdk
  12. javascript 判断对象类型
  13. git查日志命令
  14. 关于Java中static关键字的用法以及从内存角度解析
  15. R和Python,对抗or融合?
  16. 如何查看SQL SERVER数据库当前连接数
  17. MyEclipse中将项目的编码从默认GBK改变为默认UTF-8
  18. maven的注意点
  19. ace -- api
  20. 【Devops】【docker】【CI/CD】关于jenkins构建成功后一步,执行的shell命令详解+jenkins容器运行宿主机shell命令的实现方法

热门文章

  1. 冷饭新炒:理解JDK中UUID的底层实现
  2. JavaFx ObservableList的使用详解
  3. elasticsearch从开始到永久
  4. using-pointers-to-remove-item-from-singly-linked-list
  5. 洛谷 P4999
  6. Oracle数据库查询锁表及解锁
  7. Horde Groupware Webmail Edition 远程命令执行
  8. Deep Learning论文翻译(Nature Deep Review)
  9. Hive配置Tez引擎踩坑
  10. Scala集合库、模式匹配和样例类