box-css3
父容器样式必须有定义:"{ display: -webkit-box }"
现象:水平时只能在一行布局,子容器在垂直方向上会填充父容器。
技巧:可以做水平居中和垂直居中。也可以实现经典的n列布局
说明:本文所用到的属性只在webkit内核的浏览器上做过测试
box-origin (horizontal)
The box-orient property specifies whether the children of a box should be laid out horizontally or vertically.
Children within a horizontal box are displayed from left to right, and children within a vertical box are displayed top to bottom. However, the box-direction and box-ordinal-group properties can change this ordering.
box-orient: horizontal|vertical|inline-axis|block-axis|inherit;
Default value: inline-axis
box-direction
The box-direction property specifies the direction in which child elements of a box element are laid out.
box-direction: normal|reverse|inherit;
reverse: Display the child elements in the reverse direction
Default value: normal
box-pack (水平方向)
The box-pack property specifies where child elements of a box are placed when the box is larger than the size of the children. This property specifies the horizontal position in horizontal boxes, and the vertical position in vertical boxes.
box-pack: start|end|center|justify;
Default value: start
box-align (垂直方向)
The box-align property specifies how to align the child elements of a box.
box-align: start|end|center|baseline|stretch;
Default value: stretch
box-flex (定义在子容器中)
The box-flex property specifies whether the child elements of a box is flexible or inflexible in size.
Elements that are flexible can shrink or grow as the box shrinks and grows. Whenever there is extra space in a box, flexible elements are expanded to fill that space.
box-flex: value;
Default value: 0.0 (indicates that the element is inflexible)
box-css3的更多相关文章
- CSS3入门
CSS3 w3cschools css3 MDN英文 MDN中文 CSS3 is the latest evolution of the Cascading Style Sheets langua ...
- BFC(Box Formatting Context)的原理
BFC 已经是一个耳听熟闻的词语了,网上有许多关于 BFC 的文章,介绍了如何触发 BFC 以及 BFC 的一些用处(如清浮动,防止 margin 重叠等).虽然我知道如何利用 BFC 解决这些问题, ...
- 显示层封装及实现与优化(无动画+css3动画+js动画)
showhide.html <!DOCTYPE html> <html lang="en"> <head> <meta charset=& ...
- 前端精选文摘:BFC 神奇背后的原理
BFC 已经是一个耳听熟闻的词语了,网上有许多关于 BFC 的文章,介绍了如何触发 BFC 以及 BFC 的一些用处(如清浮动,防止 margin 重叠等).虽然我知道如何利用 BFC 解决这些问题, ...
- 浅析CSS中的BFC和IFC
1. 为什么会有BFC和IFC 首先要先了解两个概念:Box和formatting context: Box:CSS渲染的时候是以Box作为渲染的基本单位.Box的类型由元素的类型和display属性 ...
- 什么是BFC?(转载)
在解释 BFC 是什么之前,需要先介绍 Box.Formatting Context的概念. Box: CSS布局的基本单位 Box 是 CSS 布局的对象和基本单位, 直观点来说,就是一个页面是由很 ...
- 前端里神奇的BFC 原理剖析
以前在做自适应两栏布局的时候别人口中听到bfc这个词,于是看了各种关于bfc的文章,发现梦想天空介绍的不错,今天就在他的基础上润色一下. 一.BFC是什么? 在解释 BFC 是什么之前,需要先介绍 B ...
- BFC 神奇背后的原理
BFC已经是一个耳听熟闻的词语了,网上有许多关于BFC的文章,介绍了如何触发BFC, 以及BFC的一些用处(如清浮动,防止margin重叠等).虽然我知道如何利用BFC解决这些问题,但当别人问我BFC ...
- 【转】前端精选文摘:BFC 神奇背后的原理
BFC 已经是一个耳听熟闻的词语了,网上有许多关于 BFC 的文章,介绍了如何触发 BFC 以及 BFC 的一些用处(如清浮动,防止 margin 重叠等).虽然我知道如何利用 BFC 解决这些问题, ...
- 全面理解BFC
BFC 已经是一个耳听熟闻的词语了,网上有许多关于 BFC 的文章,介绍了如何触发 BFC 以及 BFC 的一些用处(如清浮动,防止 margin 重叠等).虽然我知道如何利用 BFC 解决这些问题, ...
随机推荐
- 五种创建UIImage的类方法
五种创建UIImage的类方法 UIImage有五个类方法,用来创建UIImage的.下面介绍一下每个类方法的作用和创建实例. 1.使用类方法imageNamed:创建 + (UIImage *)im ...
- android学习笔记 activity生命周期&任务栈&activity启动模式
activity生命周期 完整生命周期 oncreate->onstart->onresume->onpause->onstop->ondestory 使用场景:应用程序 ...
- OC语言-07-OC语言-Foundation框架
结构体 NSRange/CGRange 用来表示一个元素在另一个元素中的范围,NSRange等价于CGRange 包含两个属性: NSUInteger location:表示一个元素在另一个元素中的位 ...
- win7操作技巧
Q : 打开文件夹默认最大化A :随便打开一个文件夹 鼠标移动到左上角 然后点击鼠标左键 选择“最大化” 后关闭 之后每次打开就是最大化了
- mockmvc 静态引入
perform方法编译报错时,在头部静态引入即可 import static org.springframework.test.web.servlet.result.MockMvcResultMatc ...
- 设计模式 --- 单例模式(Singleton)
一.概念 单例模式是一种常用的软件设计模式.在它的核心结构中只包含一个被称为单例的特殊类.通过单例模式可以保证系统中一个类只有一个实例而且该实例易于外界访问,从而方便对实例个数的控制并节约系统资源.如 ...
- virtualbox 安装 虚拟机的时候报错不能创建新任务
找到原因是因为自己的windows是破解的, 找到C:\Windows\system32\uxtheme.dll这个文件,我的破解的windows在这里自带了一个uxtheme.dll.backup的 ...
- JS 中html 动态替换
一.定义通用替换js函数,或调用JQuery验证的$.format函数: //----通用JS操作// var a = "我喜欢吃{0},也喜欢吃{1},但是最喜欢的还是{0},偶尔再买点{ ...
- MySql查询语句中解决“该列没有包含在聚合函数或者groupby子句中”的相关问题方法
首先引入语句来源,表结构和数据如下: 需求是:查出员工(personname)在不同店铺(store)的总薪酬(salary),相同店铺输出store,不同店铺输出multi_store. 正确查询语 ...
- Java小方法
/** * 计算百分比. * @param dividend 被除数 * @param divisor 除数 * @return 结果 */ private String getPercent(lon ...