Phong cách rõ ràng thuộc tính
Thí dụ
Cấm các đối tượng nổi ở phía bên trái của văn bản trong một phần tử:
document.getElementById("demo").style.clear = "left";
Định nghĩa và Cách sử dụng
Thuộc tính clear đặt hoặc trả về vị trí của phần tử so với các đối tượng nổi.
Hỗ trợ trình duyệt
Property | |||||
---|---|---|---|---|---|
clear | Yes | Yes | Yes | Yes | Yes |
Cú pháp
Trả lại tài sản rõ ràng:
object.style.clear
Đặt thuộc tính rõ ràng:
object.style.clear = "none|left|right|both|initial|inherit"
Giá trị tài sản
Value | Description |
---|---|
none | Allows floating objects on both sides of the element. This is default |
left | No floating objects allowed on the left side of the element |
right | No floating objects allowed on the right side of the element |
both | No floating objects allowed on either the left or right side of the element |
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 ai |
---|---|
Giá trị trả lại: | Một chuỗi, đại diện cho vị trí của một phần tử so với các đối tượng nổi |
Phiên bản CSS | CSS1 |
Các ví dụ khác
Thí dụ
Trả lại tài sản rõ ràng:
alert(document.getElementById("demo").style.clear);
Các trang liên quan
Hướng dẫn CSS: CSS Float
Tham chiếu CSS: thuộc tính rõ ràng
❮ Đối tượng phong cách