Đường viền phong cách
Thí dụ
Chỉ định hình ảnh làm đường viền xung quanh phần tử <div>:
document.getElementById("myDIV").style.borderImage = "url(border.png) 30 30 round";
Định nghĩa và Cách sử dụng
Thuộc tính borderImage là thuộc tính viết tắt để thiết lập các thuộc tính borderImageSource , borderImageSlice , borderImageWidth , borderImageOutset và borderImageRepeat .
Các giá trị bị bỏ qua được đặt thành giá trị mặc định của chúng.
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 là Webkit, Moz hoặc O chỉ định phiên bản đầu tiên hoạt động với tiền tố.
Property | |||||
---|---|---|---|---|---|
borderImage | 16.0 4.0 Webkit |
11.0 | 15.0 3.5 Moz |
6.0 3.1 Webkit |
15.0 11.0 O |
Cú pháp
Trả lại thuộc tính border
object.style.borderImage
Đặt thuộc tính borderImage:
object.style.borderImage = "source slice width outset repeat|initial|inherit"
Giá trị tài sản
Value | Description |
---|---|
borderImageSource | The path to the image to be used as a border |
borderImageSlice | The inward offsets of the image-border |
borderImageWidth | The widths of the image-border |
borderImageOutset | The amount by which the border image area extends beyond the border box |
borderImageRepeat | Whether the image-border should be repeated, rounded or stretched |
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ăng 100% 1 0 |
---|---|
Giá trị trả lại: | Một chuỗi, đại diện cho thuộc tính hình ảnh đường viền của một phần tử |
Phiên bản CSS | CSS3 |
Các trang liên quan
Tham chiếu CSS: thuộc tính border-image