Thuộc tính ngắt từ CSS
Định nghĩa và cách sử dụng
Thuộc tính word-break
chỉ định cách ngắt từ khi đến cuối dòng.
Giá trị mặc định: | Bình 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ãy thử |
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 | Demo |
---|---|---|
normal | Default value. Uses default line break rules | |
break-all | To prevent overflow, word may be broken at any character | Demo ❯ |
keep-all | Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as value "normal" | Demo ❯ |
break-word | To prevent overflow, word may be broken at arbitrary points | Demo ❯ |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |