Thuộc tính style alignSelf
Thí dụ
Đặt căn chỉnh cho một trong các mục bên trong phần tử linh hoạt để vừa với vùng chứa:
document.getElementById("myBlueDiv").style.alignSelf = "stretch";
Định nghĩa và Cách sử dụng
Thuộc tính alignSelf chỉ định căn chỉnh cho mục đã chọn bên trong vùng chứa linh hoạt.
Lưu ý: Thuộc tính alignSelf ghi đè thuộc tính alignItems của vùng chứa linh hoạt.
Hỗ trợ trình duyệt
Các số trong bảng chỉ định phiên bản trình duyệt đầu tiên hỗ trợ đầy đủ thuộc tính.
Các số theo sau bởi Webkit chỉ định phiên bản đầu tiên hoạt động với tiền tố.
Property | |||||
---|---|---|---|---|---|
alignSelf | 21.0 | 11.0 | 20.0 | 9.0 7.0 Webkit |
12.1 |
Cú pháp
Trả về thuộc tính alignSelf:
object.style.alignSelf
Đặt thuộc tính alignSelf:
object.style.alignSelf = "auto|stretch|center|flex-start|flex-end|baseline|initial|inherit"
Giá trị tài sản
Value | Description |
---|---|
auto | Default. The element inherits its parent container's align-items property, or "stretch" if it has no parent container |
stretch | The element is positioned to fit the conatiner |
center | The element is positioned at the center of the container |
flex-start | The element is are positioned at the beginning of the container |
flex-end | The element is positioned at the end of the container |
baseline | The element is positioned at the baseline of the container |
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: | Tự động |
---|---|
Giá trị trả lại: | Một chuỗi, đại diện cho thuộc tính align-self của một phần tử |
Phiên bản CSS | CSS3 |
Các trang liên quan
Tham chiếu CSS: thuộc tính align-self
HTML DOM STYLE Tham chiếu: thuộc tính alignContent
HTML DOM STYLE Tham khảo: thuộc tính alignItems