text

英 [tekst]? ?美 [t?kst]??

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

v.發(fā)短信

overflow

英 [???v??fl??]? ?美 [?o?v?r?flo?]??

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

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

vi.泛濫,溢出;充溢

adj.溢出的,滿出的

css text-overflow屬性 語法

作用:text-overflow 屬性規(guī)定當(dāng)文本溢出包含元素時發(fā)生的事情。

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

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

注釋:所有主流瀏覽器都支持 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>下面兩個 div 包含無法在框中容納的長文本。正如您所見,文本被修剪了。</p>
<p>這個 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>這個 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>
運(yùn)行實(shí)例 ?

點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例