首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

运用CSS截断过长标题文字的方法

2013-02-03 
使用CSS截断过长标题文字的方法整理磁盘,发现这个小东东,发一文备忘。测试文件test.html代码如下:!DOCTYPE

使用CSS截断过长标题文字的方法

整理磁盘,发现这个小东东,发一文备忘。

测试文件test.html代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>使用CSS截断过长标题文字的方法</title><style type="text/css"><!--.htmer{width: 200px;white-space: nowrap;overflow: hidden;text-overflow:ellipsis;      /*兼容IE*/}--></style></head><body><div class="htmer">使用CSS截断过长标题文字的方法</div></body></html>

IE(V9.0)效果
运用CSS截断过长标题文字的方法

chrome(V8.0.552)效果:

运用CSS截断过长标题文字的方法

FireFox(V12.0)效果

运用CSS截断过长标题文字的方法

热点排行