margin问题
2016-03-02 16:05
253 查看
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style> .box{ background-color: green; overflow: hidden; <margin-top会传递,使得两个框不挨着最上边而是有50px的尺寸> zoom:1; <zoom触发haslayout> <上下margin会叠加分别给出margin-top> } .item{ height: 50px; background-color: red; margin-top: 50px; } .mt100{ margin-top: 100px; } </style> <!-- 1、margin-top传递 触发BFC、haslayout 2、上下margin叠压 尽量使用同一方向的margin,比如都设置top或者bottom, --> </head> <body> <div class="box"> <div class="item"></div> <div class="item mt100"></div> </div> </body> </html>
相关文章推荐
- poj2723 2分 + 2-sat
- Android 页面选择小圆点(页面显示自定义控件)
- iOS 工程中project和target的区别
- Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift 论文翻译
- node.js第一弹
- 设计模式 ( 十七) 状态模式State(对象行为型)
- linux下socket通信,server和client简单例子
- Java 机器学习 工具 & 库
- PHP无限极分类
- (转)log4net的配置详解
- LVS+Keepalived搭建
- 判断App处于前台还是后台
- jquery 的mmgrid 加载数据时的传参数的方式
- Cygwin中vi编辑器方向键和Backspace键不好使的解决方法
- 知识库
- LeetCode Delete Node in a Linked List
- C++第一次上机报告
- Hi~ o(* ̄▽ ̄*)ブ
- android Fragment FragmentActivity 选项卡 replace add hide show
- BIT2014级软件学院程序设计-18 A Knight's Journey