Thuộc tính bên trái đường viền CSS
Thí dụ
Đặt kiểu của đường viền bên trái cho các phần tử khác nhau:
h1 {
border-left: 5px solid red;
}
h2 {
border-left: 4px dotted blue;
}
div {
border-left: double;
}
Định nghĩa và Cách sử dụng
Thuộc border-left
tính là một thuộc tính viết tắt cho (theo thứ tự sau):
- viền-trái-chiều rộng
- border-left-style (bắt buộc)
- viền-trái-màu
Nếu màu viền trái bị bỏ qua, màu được áp dụng sẽ là màu của văn bản.
Giá trị mặc định: | vừa không có màu |
---|---|
Thừa hưởng: | không |
Hoạt hình: | có, hãy xem các thuộc tính riêng lẻ . Đọc về hoạt hình |
Phiên bản: | CSS1 |
Cú pháp JavaScript: | object .style.borderLeft = "3px dotted blue" |
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.
Property | |||||
---|---|---|---|---|---|
border-left | 1.0 | 4.0 | 1.0 | 3.5 | 1.0 |
Cú pháp CSS
border-left: border-width border-style border-color|initial|inherit;
Giá trị tài sản
Value | Description |
---|---|
border-left-width | Optional. Specifies the width of the left border. Default value is "medium" |
border-left-style | Required. Specifies the style of the left border. Default value is "none" |
border-left-color | Optional. Specifies the color of the left border. Default value is the color of the text |
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
Hướng dẫn CSS: Đường viền CSS
Tham chiếu DOM HTML: thuộc tính borderLeft