Thuộc tính kiểu wordWrap
Ví dụ
Cho phép các từ dài có thể ngắt và ngắt dòng tiếp theo:
document.getElementById("myDIV").style.wordWrap = "break-word";
Hãy tự mình thử »Sự miêu tả
Thuộc tính wordWrap cho phép các từ dài có thể được ngắt dòng và ngắt dòng sang 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: | Bình thường |
---|---|
Giá trị trả về: | Một Chuỗi, biểu thị thuộc tính word-wrap của một phần tử |
Phiên bản CSS | CSS3 |
Trang liên quan
Tham chiếu CSS: thuộc tính word-wrap