Thuộc tính kiểu flexDirection
Ví dụ
Sắp xếp lại hướng của các mục linh hoạt bên trong phần tử <div>:
document.getElementById("main").style.flexDirection = "column-reverse";
Hãy tự mình thử »Sự miêu tả
Thuộc tính flexDirection đặt hoặc trả về hướng của các mục linh hoạt.
Lưu ý: Nếu phần tử không phải là mục linh hoạt thì thuộc tính flexDirection sẽ không có hiệu lực.
Hỗ trợ trình duyệt
Property | |||||
---|---|---|---|---|---|
flexDirection | Yes | 11.0 | Yes | 9.0 | Yes |
Cú pháp
Trả về thuộc tính flexDirection:
object .style.flexDirection
Đặt thuộc tính flexDirection:
object .style.flexDirection = "row|row-reverse|column|column-reverse|initial|inherit"
Giá trị tài sản
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 |
Chi tiết kỹ thuật
Giá trị mặc định: | hàng ngang |
---|---|
Giá trị trả về: | Một Chuỗi, biểu thị thuộc tính flex-direction của một phần tử |
Phiên bản CSS | CSS3 |
Trang liên quan
Tham khảo CSS: thuộc tính flex-direction
Tham chiếu STYLE DOM HTML: thuộc tính flex
Tham khảo STYLE DOM HTML: thuộc tính flexBasis
Tham chiếu STYLE DOM HTML: thuộc tính flexFlow
Tham chiếu STYLE DOM HTML: thuộc tính flexGrow
Tham chiếu STYLE DOM HTML: thuộc tính flexShrink
HTML DOM STYLE Tham khảo: thuộc tính flexWrap