使用范例
<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>
分享到:
相关推荐
在.NET框架中,GridView控件是ASP.NET网页开发中常用的一种数据展示工具,它能够以表格形式呈现数据库或其他数据源中的信息。在处理大量数据时,可能会遇到某个字段的值过长,导致列宽不足以完全显示的情况。为了...
设置为 `nowrap` 可以防止文本换行,保证文本在一行内显示,这是实现单行文本溢出显示省略号的必要条件。 2. 实现单行文本溢出显示省略号的方法: - 当需要在单行文本末尾显示省略号时,可以组合使用上述三个属性...
在 Jupyter Notebook 中,Pandas 库的 DataFrame 对象在默认情况下,为了保持界面整洁,可能会对过长的表格进行截断显示。这包括在行数过多或列数过多时自动换行或省略部分内容。这种行为虽然有其合理性,但有时会...
为了避免表格列过宽,可以限制单元格中显示的文本长度,并用省略号代替多余的部分。这可以通过设置`ItemStyle.Width`属性并使用HTML的`title`属性显示完整文本作为提示。 #### 11. GridView一般换行与强制换行 在...
1. 首先,确保在你的Vue组件模板中,为需要检测宽度的元素添加一个引用(ref)。例如: ```html 这是需要检测宽度的文本 ``` 2. 在Vue组件的`mounted`或`updated`生命周期钩子中,你可以访问这个引用并进行宽度比较...
defaultValue,第一种用法不给缺失的变量指定默认值,表明默认值是空字符串,长度为0的集合,或者长度为0的Map对象. 使用!指定默认值时,并不要求默认值的类型和变量类型相同.使用??运算符非常简单,它总是返回一个布尔值...