Thuộc tính dấu gạch nối CSS
Thí dụ
Đặt các dấu gạch nối khác nhau:
div.a {
-webkit-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
div.b {
-webkit-hyphens: manual;
-ms-hyphens:
manual;
hyphens: manual;
}
div.c {
-webkit-hyphens:
auto;
-ms-hyphens: auto;
hyphens: auto;
}
Định nghĩa và Cách sử dụng
Thuộc hyphens
tính xác định xem dấu gạch nối có được phép tạo nhiều cơ hội bọc mềm hơn trong một dòng văn bản hay không.
Giá trị mặc định: | thủ cô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.hyphens = "none" |
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 | |||||
---|---|---|---|---|---|
hyphens | 55.0 | 79.0 10.0 -ms- |
43.0 | 5.1 -webkit- | 44.0 |
Cú pháp CSS
hyphens: none|manual|auto|initial|inherit;
Giá trị tài sản
Value | Description |
---|---|
none | Words are not hyphenated |
manual | Default. Words are only hyphenated at ‐ or ­ (if needed) |
auto | Words are hyphenated where the algorithm is deciding (if needed) |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |