Thuộc tính style wordWrap
Thí dụ
Cho phép các từ dài có thể ngắt và chuyển sang dòng tiếp theo:
document.getElementById("myDIV").style.wordWrap = "break-word";
Định nghĩa và Cách sử dụng
Thuộc tính wordWrap cho phép các từ dài có thể được ngắt và quấn vào dòng tiếp theo.
Hỗ trợ trình duyệt
Property | |||||
---|---|---|---|---|---|
wordWrap | Yes | Yes | Yes | Yes | Yes |
Cú pháp
Trả về thuộc tính wordWrap:
object.style.wordWrap
Đặt thuộc tính wordWrap:
object.style.wordWrap = "normal|break-word|initial|inherit"
Giá trị tài sản
Value | Description |
---|---|
normal | Break words only at allowed break points |
break-word | Allows unbreakable words to be broken |
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: | thông thường |
---|---|
Giá trị trả lại: | Một chuỗi, đại diện cho thuộc tính bọc từ 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 word-wrap
❮ Đối tượng phong cách