`

表格中长度太长,显示在一行多余长度不显示或显示为省略号

    博客分类:
  • HTML
阅读更多

使用范例

<HTML> 
<BODY> 
<DIV   STYLE= "text-decoration:underline;color:darkRed; 
font:   bold   20px   Arial;font-weight:bold "> 
Effect   of   CSS   property   <I> text-overflow </I> </DIV> 
<DIV   STYLE= "font:   bold   16px   Arial;   color:darkRed;   font-weight:bold "> 
Each   box   (DIV   element)   below   contains   the   following   text: </DIV> 
<DIV   > We   hold   these   truths   to   be   self-evident, 
that   all   people   are   created   equal. </DIV> 
<DIV   STYLE= "font:   bold   16px   Arial;color:darkRed;   font-weight:bold "> 
Note   how   the   STYLE   settings   effect   the   rendering   of   the   text </DIV> 
<DIV   STYLE= "position:   relative;   height:   75px;   top:10 "> 
<DIV   STYLE= "position:   absolute;   left:   10px; 
font:   bold   16px   Arial,   sans-serif;   color:   blue;   "> 
STYLE   = "text-overflow   :   clip;   overflow   :   hidden " 
<DIV   STYLE= "position:   absolute;   left:   0px;   top:   18px;   color:   black; 
width:   120px;   height:   50px;   border:   1px   solid   blue; 
font:   14px   Times   New   Roman,   serif;   overflow:   hidden; 
text-overflow:clip "> 
<NOBR> We   hold   these   truths   to   be   self-evident, 
that   all   people   are   created   equal. </NOBR> 
</DIV> 
</DIV> 
<DIV   STYLE= "position:   relative;   height:   75px;   top:   70 "> 
<DIV   STYLE= "position:   absolute;   left:   10px; 
font:   bold   16px   Arial,   sans-serif;   color:   blue;   "> 
STYLE   = "text-overflow   :   ellipsis;   overflow   :   hidden " 
<DIV   STYLE= "position:   absolute;   left:   0px;   top:   18px;   color:   black; 
width:   120px;   height:   50px;   border:   1px   solid   blue; 
font:   14px   Times   New   Roman,   serif;   overflow:   hidden; 
text-overflow:ellipsis "> 
<NOBR> We   hold   these   truths   to   be   self-evident, 
that   all   people   are   created   equal. </NOBR> 
</DIV> 
</DIV> 
<DIV   STYLE= "position:   relative;   height:   75px;   top:70 "> 
<DIV   STYLE= "position:   absolute;   left:   10px; 
font:   bold   16px   Arial,   sans-serif;   color:   blue;   "> 
STYLE   = "text-overflow   :   ellipsis;   overflow   :   visible " 
<DIV   STYLE= "position:   absolute;   left:   0px;   top:   18px;   color:   black; 
width:   120px;   height:   50px;   border:   1px   solid   blue; 
font:   14px   Times   New   Roman,   serif;   overflow:   visible; 
text-overflow:ellipsis "> 
<NOBR> We   hold   these   truths   to   be   self-evident, 
that   all   people   are   created   equal. </NOBR> 
</DIV> 
</DIV> 
</BODY> 
</HTML> 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics