Thuộc tính style borderLeftColor
Thí dụ
Thay đổi màu của đường viền bên trái của phần tử <div> thành màu đỏ:
document.getElementById("myDiv").style.borderLeftColor = "red";
Định nghĩa và Cách sử dụng
Thuộc tính borderLeftColor đặt hoặc trả về màu của đường viền bên trái của một phần tử.
Hỗ trợ trình duyệt
Property | |||||
---|---|---|---|---|---|
borderLeftColor | Yes | Yes | Yes | Yes | Yes |
Cú pháp
Trả về thuộc tính borderLeftColor:
object.style.borderLeftColor
Đặt thuộc tính borderLeftColor:
object.style.borderLeftColor = "color|transparent|initial|inherit"
Giá trị tài sản
Value | Description |
---|---|
color | Specifies the color of the left border. Look at CSS Color Values for a complete list of possible color values. Default color is the current color of the element |
transparent | The color of the left border is transparent (underlying content will shine through) |
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: | màu hiện tại |
---|---|
Giá trị trả lại: | Một chuỗi, đại diện cho màu của đường viền bên trái của một phần tử |
Phiên bản CSS | CSS1 |
Các ví dụ khác
Thí dụ
Trả lại màu đường viền bên trái của phần tử <div>:
alert(document.getElementById("myDiv").style.borderLeftColor);
Các trang liên quan
Hướng dẫn CSS: Đường viền CSS
Tham chiếu CSS: thuộc tính border-left-color
Tham chiếu DOM HTML: thuộc tính đường viền