×
CSS 参考手册CSS 选择器CSS 听觉参考手册CSS Web安全字体组合CSS 动画CSS 单位CSS 颜色CSS 合法颜色值CSS 颜色名称CSS 颜色十六进制值CSS 浏览器支持

CSS 属性

align-contentalign-itemsalign-selfallanimation(动画)animation-delayanimation-directionanimation-durationanimation-fill-modeanimation-iteration-countanimation-nameanimation-play-stateanimation-timing-functionappearancebackface-visibilitybackgroundbackground-attachmentbackground-blend-modebackground-clipbackground-colorbackground-imagebackground-originbackground-positionbackground-repeatbackground-sizeborderborder-bottomborder-bottom-colorborder-bottom-left-radiusborder-bottom-right-radiusborder-bottom-styleborder-bottom-widthborder-collapseborder-colorborder-imageborder-image-outsetborder-image-repeatborder-image-sliceborder-image-sourceborder-image-widthborder-leftborder-left-colorborder-left-styleborder-left-widthborder-radiusborder-rightborder-right-colorborder-right-styleborder-right-widthborder-spacingborder-styleborder-topborder-top-colorborder-top-left-radiusborder-top-right-radiusborder-top-styleborder-top-widthborder-widthbottombox-alignbox-directionbox-flexbox-flex-groupbox-linesbox-ordinal-groupbox-orientbox-packbox-shadowbox-sizingcaption-sideclearclipcolorcolumn-countcolumn-fillcolumn-gapcolumn-rulecolumn-rule-colorcolumn-rule-stylecolumn-rule-widthcolumn-spancolumn-widthcolumnscontentcounter-incrementcounter-resetcursordirectiondisplayempty-cellsfilter(滤镜)flexflex-basisflex-directionflex-flowflex-growflex-shrinkflex-wrapfloatfont@font-facefont-familyfont-sizefont-size-adjustfont-stretchfont-stylefont-variantfont-weightgrid-columnsgrid-rowshanging-punctuationheighticonjustify-content@keyframesleftletter-spacingline-heightlist-stylelist-style-imagelist-style-positionlist-style-typemarginmargin-bottommargin-leftmargin-rightmargin-topmax-heightmax-width@mediamin-heightmin-widthnav-downnav-indexnav-leftnav-rightnav-upopacityorderoutlineoutline-coloroutline-offsetoutline-styleoutline-widthoverflowoverflow-xoverflow-ypaddingpadding-bottompadding-leftpadding-rightpadding-toppage-break-afterpage-break-beforepage-break-insideperspectiveperspective-originpositionpunctuation-trimquotesresizerightrotationtab-sizetable-layouttargettarget-nametarget-newtarget-positiontext-aligntext-align-lasttext-decorationtext-decoration-colortext-decoration-linetext-decoration-styletext-indenttext-justifytext-outlinetext-overflowtext-shadowtext-transformtext-wraptoptransformtransform-origintransform-styletransitiontransition-delaytransition-durationtransition-propertytransition-timing-functionunicode-bidivertical-alignvisibilitywhite-spacewidthword-breakword-spacingword-wrapz-indexwriting-mode

CSS3 box-align 属性


实例

对div中的子元素同时使用box-align和box-pack的居中属性:

div
{
width:350px;
height:100px;
border:1px solid black;

/* Internet Explorer 10 */
display:-ms-flexbox;
-ms-flex-pack:center;
-ms-flex-align:center;

/* Firefox */
display:-moz-box;
-moz-box-pack:center;
-moz-box-align:center;

/* Safari, Opera, and Chrome */
display:-webkit-box;
-webkit-box-pack:center;
-webkit-box-align:center;

/* W3C */
display:box;
box-pack:center;
box-align:center;
}

尝试一下 »
在此页底部有更多的例子。

浏览器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

目前所有主流浏览器都不支持 box-align 属性。

Internet Explorer 10 通过私有属性 -ms-flex-align 支持.

Firefox通过私有属性- MOZ-box-align支持。

Safari和Chrome通过私有属性-WebKit-box-align支持。

注意:Internet Explorer 9及更早IE版本不支持弹性盒子。


属性定义及使用说明

box- align属性指定box的子元素如何对齐。

默认值: stretch
继承: no
版本: CSS3
JavaScript 语法: object.style.boxAlign="center"


语法

box-align: start|end|center|baseline|stretch;

说明
start 对于正常方向的boxes,每个子元素的顶部边缘放在沿box的顶部。反向箱,每个子元素的底边放在沿box的底部
end 对于正常方向的boxes,每个子元素的顶部边缘放在沿box的底部。反向箱,每个子元素的底边放在沿box的顶部
center 任何多余的空间被划分均匀,一半以上的子元素放在上面,剩下的子元素放在另一半
baseline 如果box-orient是内嵌单轴或横向,所有的子元素都置于他们的基线对齐
stretch 子元素拉伸以填充包含区块


Examples

在线实例

更改一个元素的box对齐值
这个例子演示了如何使用JavaScript来改变一个元素box-align值。


分类导航

关注微信下载离线手册

bootwiki移动版 bootwiki
(群号:472910771)