Thuộc tính style borderLeftColor
Ví dụ
Thay đổi màu viền trái của phần tử <div> thành màu đỏ:
document.getElementById("myDiv").style.borderLeftColor = "red";
Hãy tự mình thử »Sự miêu tả
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ả về: | Một Chuỗi, biểu thị màu của đường viền trái của phần tử |
Phiên bản CSS | CSS1 |
Thêm ví dụ
Ví dụ
Trả về màu đường viền bên trái của phần tử <div>:
alert(document.getElementById("myDiv").style.borderLeftColor);
Hãy tự mình thử »Trang liên quan
Hướng dẫn CSS: Đường viền CSS
Tham khảo CSS: thuộc tính border-left-color
Tham chiếu DOM HTML: thuộc tính đường viền