Latest web development tutorials

HTML DOM Style flexFlow 屬性

Style 對象參考手冊 Style對象

實例

讓靈活的項目以列的形式顯示,且不拆列:

document.getElementById("main").style.flexFlow="column nowrap";

嘗試一下»

定義和用法

flexFlow 屬性是flexDirection 和flexWrap 屬性的速記屬性。

flexDirection 屬性規定靈活項目的方向。

flexWrap 屬性規定靈活項目是否拆行或拆列。

注意:如果元素不是靈活的項目,則flexFlow屬性不起作用。


瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Firefox、Opera 和Chrome 支持flexFlow 屬性。


語法

返回flexFlow 屬性:

object .style.flexFlow

設置flexFlow 屬性:

object .style.flexFlow="flex-directionflex-wrap |initial|inherit"

屬性值

描述
flex-direction 可能的值:

row
row-reverse
column
column-reverse
initial
inherit

默认值是 "row"。

规定灵活项目的方向。

flex-wrap 可能的值:

nowrap
wrap
wrap-reverse
initial
inherit

默认值是 "nowrap"。

规定灵活项目是否拆行或拆列。

initial 设置该属性为它的默认值。请参阅 initial
inherit 从父元素继承该属性。请参阅 inherit

技術細節

默認值: row nowrap
返回值: 字符串,表示元素的flex-flow 屬性。
CSS 版本 CSS3


相關文章

CSS參考手冊: flex-flow屬性

HTML DOM STYLE參考手冊: flex屬性

HTML DOM STYLE參考手冊: flexBasis屬性

HTML DOM STYLE參考手冊: flexDirection屬性

HTML DOM STYLE參考手冊: flexGrow屬性

HTML DOM STYLE參考手冊: flexShrink屬性

HTML DOM STYLE參考手冊: flexWrap屬性


Style 對象參考手冊 Style對象