Phong cách rõ ràng
Ví 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";
Hãy tự mình thử »Sự miêu tả
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 thuộc tính 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 có |
---|---|
Giá trị trả về: | Một Chuỗi, biểu thị 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 |
Thêm ví dụ
Ví dụ
Trả lại thuộc tính rõ ràng:
alert(document.getElementById("demo").style.clear);
Hãy tự mình thử »Trang liên quan
Hướng dẫn CSS: CSS Float
Tham chiếu CSS: thuộc tính rõ ràng