Phác thảo kiểu Thuộc tính màu
Ví dụ
Thay đổi màu đường viền của phần tử <div>:
document.getElementById("myDiv").style.outlineColor = "#00ff00";
Hãy tự mình thử »Sự miêu tả
Thuộc tính OutlineColor đặt hoặc trả về màu của đường viền xung quanh một phần tử.
Đường viền là một đường bao quanh một phần tử. Nó được hiển thị xung quanh lề của phần tử. Tuy nhiên, nó khác với thuộc tính border.
Đường viền không phải là một phần kích thước của phần tử, do đó thuộc tính chiều rộng và chiều cao của phần tử không chứa chiều rộng của đường viền.
Hỗ trợ trình duyệt
Property | |||||
---|---|---|---|---|---|
outlineColor | Yes | Yes | Yes | Yes | Yes |
Cú pháp
Trả về thuộc tính OutlineColor:
object .style.outlineColor
Đặt thuộc tính OutlineColor:
object .style.outlineColor = "color |invert|initial|inherit"
Giá trị tài sản
Value | Description |
---|---|
color | Specifies the color of the outline. Look at CSS Color Values for a complete list of possible color values |
invert | Inverts the color of the outline to the opposite value. Note: Browsers are not required to support this 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: | đảo ngược |
---|---|
Giá trị trả về: | Một Chuỗi, biểu thị màu của đường viền của phần tử |
Phiên bản CSS | CSS2 |
Thêm ví dụ
Ví dụ
Trả về màu đường viền của phần tử <div>:
alert(document.getElementById("myDiv").style.outlineColor);
Hãy tự mình thử »Trang liên quan
Hướng dẫn CSS: CSS Outline
Tham chiếu CSS: thuộc tính màu phác thảo
Tham chiếu DOM HTML: thuộc tính phác thảo