Danh sách kiểu dáng
Thí dụ
Thụt lề điểm đánh dấu mục danh sách:
document.getElementById("myUL").style.listStylePosition = "inside";
Định nghĩa và Cách sử dụng
Thuộc tính listStylePosition đặt hoặc trả về vị trí của điểm đánh dấu mục danh sách.
Hỗ trợ trình duyệt
Property | |||||
---|---|---|---|---|---|
listStylePosition | Yes | Yes | Yes | Yes | Yes |
Cú pháp
Trả về thuộc tính listStylePosition:
object.style.listStylePosition
Đặt thuộc tính listStylePosition:
object.style.listStylePosition = "outside|inside|initial|inherit"
Giá trị tài sản
Value | Description |
---|---|
outside | The list-item marker will be rendered before any text content. This is default |
inside | Indents the list-item marker marker |
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: | ngoài |
---|---|
Giá trị trả lại: | Một chuỗi, đại diện cho vị trí của điểm đánh dấu mục danh sách |
Phiên bản CSS | CSS1 |
Các ví dụ khác
Thí dụ
Trả lại vị trí của điểm đánh dấu mục danh sách:
alert(document.getElementById("myList").style.listStylePosition);
Các trang liên quan
Hướng dẫn CSS: Danh sách CSS
Tham chiếu CSS: thuộc tính list-style-position
Tham chiếu DOM HTML: thuộc tính listStyle
❮ Đối tượng phong cách