Thuộc tính ngắt từ CSS
Thí dụ
Ngắt từ ở bất kỳ ký tự nào:
p.a {
word-break: break-all;
}
Định nghĩa và Cách sử dụng
Thuộc word-break
tính chỉ định cách các từ sẽ ngắt khi đến cuối dòng.
Giá trị mặc định: | thông thường |
---|---|
Thừa hưởng: | Đúng |
Hoạt hình: | không. Đọc về hoạt hình |
Phiên bản: | CSS3 |
Cú pháp JavaScript: | object .style.wordBreak = "break-all" |
Hỗ trợ trình duyệt
Các số trong bảng chỉ định phiên bản trình duyệt đầu tiên hỗ trợ đầy đủ thuộc tính.
Property | |||||
---|---|---|---|---|---|
word-break | 4.0 | 5.5 | 15.0 | 3.1 | 15.0 |
Cú pháp CSS
word-break: normal|break-all|keep-all|break-word|initial|inherit;
Giá trị tài sản
Value | Description |
---|---|
normal | Default value. Uses default line break rules |
break-all | To prevent overflow, word may be broken at any character |
keep-all | Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as value "normal" |
break-word | To prevent overflow, word may be broken at arbitrary points |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |