box-css3
2013-11-22 16:58
239 查看
父容器样式必须有定义:
现象:水平时只能在一行布局,子容器在垂直方向上会填充父容器。
技巧:可以做水平居中和垂直居中。也可以实现经典的n列布局
说明:本文所用到的属性只在webkit内核的浏览器上做过测试
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: normal|reverse|inherit;
reverse: Display the child elements in the reverse direction
Default value: normal
box-pack: start|end|center|justify;
Default value: start
box-align: start|end|center|baseline|stretch;
Default value: stretch
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)
"{ 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)
相关文章推荐
- 关于学习CSS flexbox的文章或网址链接
- CSS网页实例 利用box-sizing实现div仿框架结构实现代码
- CSS外层BOX自动计算高度问题
- CSS盒模型-box-sizing
- css中box-shadow属性与text-shadow属性
- css 3中的box-sizing属性
- css布局学习笔记之box-sizing
- CSS应用 - :before, :after, box-shadow
- (十二)学习CSS之box-sizing 属性
- The CSS Box Model
- CSS-标准盒模型和怪异盒模型box-sizing
- CSS3盒模型display:box详解
- HTML+CSS基础之浅层理解box-sizing:content-box | border-box | inherit
- CSS | box-model & box-sizing
- 使用CSS flexbox创建一个干净的CSS比较表
- CSS实现跨浏览器的box-shadow盒阴影效果(2)
- 使用box-sizing让CSS布局更直观
- css做div的box阴影
- css中box-shadow的应用技巧
- css学习笔记-盒子的box-size