惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
J
Java Code Geeks
有赞技术团队
有赞技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
Apple Machine Learning Research
Apple Machine Learning Research
量子位
D
Docker
V
Visual Studio Blog
博客园 - 司徒正美
Martin Fowler
Martin Fowler
人人都是产品经理
人人都是产品经理
WordPress大学
WordPress大学
U
Unit 42
M
MIT News - Artificial intelligence
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
V
V2EX
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网
Vercel News
Vercel News
C
Check Point Blog

博客园 - fredli2005

全栈 2014年价值观察股票 突破45日线后,第一目标14.41(待验证) 【转】从开发者的角度看待各移动平台 ios/android/wp7/win8ost title 放弃移动版Flash而非AIR 从软件巨头发展看清未来的方向 通达信5分钟数据整理 看文章《EAI和SOA的比较》有感(1) Ext.data.PageMethodHttpProxy el.ownerDocument.createRange Error - fredli2005 - 博客园 Aop的一些资料 .net工具集 Log4net查看器 - fredli2005 - 博客园 w3wp意外终止 概念数据模型,逻辑数据模型,物理数据模型(转) 快速命令行 powerdesigner15 与vs2008的冲突(解决篇) 在win server 2008中配置stockTrader postSharp 学习一
关于text-overflow(一种省略文字的方式)
fredli2005 · 2009-03-02 · via 博客园 - fredli2005

关于text-overflow属性如何应用,我们作如下的说明讲解:
text-overflow属性仅是注解,当文本溢出时是否显示省略标记。并不具备其它的样式属性定义。我们想要实现溢出时产生省略号的效果。还必须定义:强制文本在一行内显示(white-space:nowrap)及溢出内容为隐藏(overflow:hidden)。只有这样才能实现溢出文本显示省略号的效果。

文章说必须要设置三个属性

text-overflow:ellipsis;

white-space:nowrap;

overflow:hidden

我测试的情况是

代码如下:’Label’不能正常显示

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd%22>
<html xmlns="http://www.w3.org/1999/xhtml%22>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
.div_24td{border:0px hidden;line-height:25px;width:230px;text-overflow:ellipsis; white-space:nowrap; overflow:hidden;}
li {width:300px; line-height:25px; text-overflow:ellipsis; white-space:nowrap; overflow:hidden;}
</style>
</head>

<body>
<li><a href="http://www.52css.com/%22>CSS实战精萃 - Pro CSS Techniquesadsfasdfasdf</a></li>
<Label class=div_24td title="你打算放阿斯蒂芬倒萨发生的发生地方大师傅俺的沙发安德森发生地方俺的沙发阿斯蒂芬大师傅阿斯顿">
你打算放阿斯蒂芬倒萨发生的发生地方大师傅俺的沙发安德森发生地方俺的沙发阿斯蒂芬大师傅阿斯顿
</Label>
</body>
</html>