text
英 [tekst]? ?美 [t?kst]??
n.文本,原文;課文,教科書;主題;版本
v.發(fā)短信
overflow
英 [???v??fl??]? ?美 [?o?v?r?flo?]??
vt.& vi.溢出,淹沒(méi);擠滿,充滿;洋溢;資源過(guò)剩
n.泛濫,溢出物;溢流管;充溢,過(guò)多;超出額
vi.泛濫,溢出;充溢
adj.溢出的,滿出的
css text-overflow屬性 語(yǔ)法
作用:text-overflow 屬性規(guī)定當(dāng)文本溢出包含元素時(shí)發(fā)生的事情。
語(yǔ)法:text-overflow: clip|ellipsis|string
說(shuō)明:clip ? ?修剪文本。? ? ? ? ellipsis ? ?顯示省略符號(hào)來(lái)代表被修剪的文本。? ?string ? ?使用給定的字符串來(lái)代表被修剪的文本。? ??
注釋:所有主流瀏覽器都支持 text-overflow 屬性。
css text-overflow屬性 示例
<!DOCTYPE html> <html> <head> <style> div.test { white-space:nowrap; width:12em; overflow:hidden; border:1px solid #000000; } </style> </head> <body> <p>下面兩個(gè) div 包含無(wú)法在框中容納的長(zhǎng)文本。正如您所見(jiàn),文本被修剪了。</p> <p>這個(gè) div 使用 "text-overflow:ellipsis" :</p> <div class="test" style="text-overflow:ellipsis;">This is some long text that will not fit in the box</div> <p>這個(gè) div 使用 "text-overflow:clip":</p> <div class="test" style="text-overflow:clip;">This is some long text that will not fit in the box</div> </body> </html>
點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例