Thuộc tính tự căn chỉnh CSS
Thí dụ
Căn giữa các căn cho một trong các mục bên trong phần tử linh hoạt:
#myBlueDiv
{
align-self: center;
}
Định nghĩa và Cách sử dụng
Thuộc align-self
tính 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 ghi đè thuộc tính align-itemsalign-self
của vùng chứa linh hoạt
.
Giá trị mặc định: | Tự động |
---|---|
Thừa hưởng: | không |
Hoạt hình: | không. Đọc về hoạt hình |
Phiên bản: | CSS3 |
Cú pháp JavaScript: | object .style.alignSelf = "center" |
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 -webkit- chỉ định phiên bản đầu tiên hoạt động với tiền tố.
Property | |||||
---|---|---|---|---|---|
align-self | 21.0 | 11.0 | 20.0 | 9.0 7.0 -webkit- |
12.1 |
Cú pháp CSS
align-self: auto|stretch|center|flex-start|flex-end|baseline|initial|inherit;
Giá trị tài sản
Value | Description | Play it |
---|---|---|
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 container | |
center | The element is positioned at the center of the container | |
flex-start | The element is 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 |
Các trang liên quan
Tham chiếu CSS: thuộc tính align-content
Tham chiếu CSS: thuộc tính align-items
Tham chiếu DOM HTML: thuộc tính alignSelf