Kiểu văn bản
Thí dụ
Thay đổi thuộc tính textOverflow:
document.getElementById("myDIV").style.textOverflow = "ellipsis";
Định nghĩa và Cách sử dụng
Thuộc tính textOverflow chỉ định điều gì sẽ xảy ra khi văn bản làm tràn phần tử chứa.
Hỗ trợ trình duyệt
Property | |||||
---|---|---|---|---|---|
textOverflow | Yes | Yes | Yes | Yes | Yes |
Cú pháp
Trả về thuộc tính textOverflow:
object.style.textOverflow
Đặt thuộc tính textOverflow:
object.style.textOverflow = "clip|ellipsis|string|initial|inherit"
Giá trị tài sản
Value | Description |
---|---|
clip | Default value. Clips the text |
ellipsis | Render an ellipsis ("...") to represent clipped text |
string | Render the given string to represent clipped text |
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: | kẹp |
---|---|
Giá trị trả lại: | Chuỗi, đại diện cho thuộc tính tràn văn bản 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 text-tràn
❮ Đối tượng phong cách