重新排列 <div> 元素内灵活项目的方向:
document.getElementById("main").style.flexDirection = "column-reverse";
亲自试一试 »
flexDirection 属性设置或返回灵活项目的方向。
笔记:如果元素不是灵活项,则 flexDirection 属性不起作用。
Property | |||||
---|---|---|---|---|---|
flexDirection | Yes | 11.0 | Yes | 9.0 | Yes |
返回 flexDirection 属性:
object.style.flexDirection
设置 flexDirection 属性:
object.style.flexDirection = "row|row-reverse|column|column-reverse|initial|inherit"
Value | Description |
---|---|
row | Default value. The flexible items are displayed horizontally, as a row |
row-reverse | Same as row, but in reverse order |
column | The flexible items are displayed vertically, as a column |
column-reverse | Same as column, but in reverse order |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
默认值: | 排 |
---|---|
返回值: | 一个 String,表示元素的 flex-direction 属性 |
CSS版本 | CSS3 |
CSS 参考:弯曲方向属性
HTML DOM 样式参考:弹性属性
HTML DOM 样式参考:flexBasis 属性
HTML DOM 样式参考:flexFlow 属性
HTML DOM 样式参考:flexGrow 属性
HTML DOM 样式参考:flexShrink 属性
HTML DOM 样式参考:flexWrap 属性
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!