text

英[tekst] 美[tɛkst]

n.文本,原文;課文,教科書;主題;版本

#v .傳簡訊

overflow

S[ˌəʊvəˈfləʊ] 美[ˌoʊvərˈfloʊ]

vt.& vi.溢出,淹沒;擠滿,充滿淹沒;洋溢;資源過剩

n.氾濫,溢出物;溢流管;充溢,過多;超出額

vi.氾濫,溢出;充溢

adj.溢出的,滿出的

CSS 文字溢出屬性 語法

作用:text-overflow 屬性規定當文字溢出包含元素時發生的事情。

語法:text-overflow: clip|ellipsis|string

說明:clip 修剪文字。 ellipsis 顯示省略符號來代表被修剪的文字。 string 使用給定的字串來代表被修剪的文字。

註解:所有主流瀏覽器都支援 text-overflow 屬性。

CSS 文字溢出屬性 範例

    
  

下面两个 div 包含无法在框中容纳的长文本。正如您所见,文本被修剪了。

这个 div 使用 "text-overflow:ellipsis" :

This is some long text that will not fit in the box

这个 div 使用 "text-overflow:clip":

This is some long text that will not fit in the box
執行實例 »

#點擊 "執行實例" 按鈕查看線上實例

#