Thuộc tính kiểu textOverflow
Ví dụ
Thay đổi thuộc tính textOverflow:
document.getElementById("myDIV").style.textOverflow = "ellipsis";
Hãy tự mình thử »Sự miêu tả
Thuộc tính textOverflow chỉ định điều gì sẽ xảy ra khi văn bản 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ả về: | Một Chuỗi, biểu thị thuộc tính tràn văn bản 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 tràn văn bản