Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

align

align
Type: one of the values below
The align attribute specifies how child elements of the box are aligned, when the size of the box is larger than the total size of the children.
当box的尺寸大于全部子元素的尺寸时,align属性指定box元素的对齐方式。
  • For boxes that have horizontal orientation, it specifies how its children will be aligned vertically.
  • 当box设置水平排列,它指定子元素如何垂直对齐。
  • For boxes that have vertical orientation, it specifies how its children will be aligned horizontally.
  • 当box设置垂直排列,它指定子元素如何水平对齐
start
Child elements are aligned starting from the left or top edge of the box. If the box is larger than the total size of the children, the extra space is placed on the right or bottom side.
子元素从box的左边或顶部开始排列。如果box大于全部子元素的总和,多出的空间在右边或底部。
center
Extra space is split equally along each side of the child elements, resulting in the children being placed in the center of the box.
多出的空间在子元素的周围,使子元素放置在box的中间。
end
Child elements are placed on the right or bottom edge of the box. If the box is larger than the total size of the children, the extra space is placed on the left or top side.
子元素从box的右边或底部开始排列。如果box大于全部子元素的总和,多出的空间在左边或顶部部。
baseline
This value applies to horizontally oriented boxes only. It causes the child elements to be aligned so that their text labels are lined up.
这个值只适用于水平方向的box元素。它让子元素的文本标签成一条直线。
stretch
This is the default value. The child elements are stretched to fit the size of the box. For a horizontal box, the children are stretched to be the height of the box. For a vertical box, the children are stretched to be the width of the box. If the size of the box changes, the children stretch to fit. Use the flex attribute to create elements that stretch in the opposite direction.
这是默认值。拉伸子元素来填充box。在水平的box元素中,子元素在高度上被拉伸。在垂直的box元素中,子元素在宽度上被拉伸。如果box元素尺寸改变,子元素也随之改变。使用flex属性创建的元素在相反方向被拉伸。
left
The elements are aligned on their left edges.
元素左边缘对齐。
center
The elements are centered horizontally.
元素水平居中。
right
The elements are aligned on their right edges.
元素右边缘对齐。
The pack attribute is related to the alignment but is used to specify the position in the opposite direction. You can also specify the value of align using the style property -moz-box-align.
pack也是有关对齐的属性,但是指定相反方向的位置。你也可以在style中使用对齐的方式-moz-box-align

文档标签和贡献者

标签: 
 此页面的贡献者: small-chair
 最后编辑者: small-chair,