Thuộc tính style borderLeftStyle
Ví dụ
Thêm đường viền bên trái "đặc" vào phần tử <div>:
document.getElementById("myDiv").style.borderLeftStyle = "solid";
Hãy tự mình thử »Sự miêu tả
Thuộc tính borderLeftStyle đặt hoặc trả về kiểu đường viền bên trái của một phần tử.
Hỗ trợ trình duyệt
Property | |||||
---|---|---|---|---|---|
borderLeftStyle | Yes | Yes | Yes | Yes | Yes |
Cú pháp
Trả về thuộc tính borderLeftStyle:
object .style.borderLeftStyle
Đặt thuộc tính borderLeftStyle:
object .style.borderLeftStyle = value
Giá trị tài sản
Value | Description |
---|---|
none | Defines no border. This is default |
hidden | Same as "none", except in border conflict resolution for table elements |
dotted | Defines a dotted border |
dashed | Defines a dashed border |
solid | Defines a solid border |
double | Defines two borders. The width of the two borders are the same as the border-width value |
groove | Defines a 3D grooved border. The effect depends on the border-color value |
ridge | Defines a 3D ridged border. The effect depends on the border-color value |
inset | Defines a 3D inset border. The effect depends on the border-color value |
outset | Defines a 3D outset border. The effect depends on the border-color value |
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: | không có |
---|---|
Giá trị trả về: | Một Chuỗi, biểu thị kiểu đường viền bên trái của một phần tử |
Phiên bản CSS | CSS1 |
Thêm ví dụ
Ví dụ
Thay đổi kiểu đường viền bên trái của phần tử <div> thành "chấm":
document.getElementById("myDiv").style.borderLeftStyle = "dotted";
Hãy tự mình thử »Ví dụ
Trả về kiểu viền trái của phần tử <div>:
alert(document.getElementById("myDiv").style.borderLeftStyle);
Hãy tự mình thử »Ví dụ
Một minh chứng cho tất cả các giá trị khác nhau:
var listValue = selectTag.options[selectTag.selectedIndex].text;
document.getElementById("myDiv").style.borderLeftStyle = listValue;
Hãy tự mình thử »Trang liên quan
Hướng dẫn CSS: Đường viền CSS
Tham chiếu CSS: thuộc tính kiểu viền trái
Tham chiếu DOM HTML: thuộc tính đường viền