我们常常希望列表中的内容,超过设置的长度的时候,不要撑开父元素,也不希望它直接换行;我们更愿意让其超过部分用省略号来代替。而在title标签中,置放的是完整的标题。 这样的方法新手们常常不知道该如何搞定。下面就是方法的演示。不过请注意此方法适用与IE与OP浏览器!
设置li超出部分显示省略号的方法
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>cnwebshow.com</title><style type="text/css"><!--li { width:200px; white-space:nowrap; text-overflow:ellipsis; overflow: hidden; }--></style></head><body><ul><li><a href="cnwebshow.com'>http://www.cnwebshow.com#">cnwebshow.com - Div CSS布局 常见问题</a></li><li><a href="cnwebshow.com'>http://www.cnwebshow.com#">cnwebshow.com - Div CSS布局 常见问题</a></li><li><a href="cnwebshow.com'>http://www.cnwebshow.com#">cnwebshow.com - Div CSS布局 常见问题</a></li><li><a href="cnwebshow.com'>http://www.cnwebshow.com#">cnwebshow.com - Div CSS布局 常见问题</a></li><li><a href="cnwebshow.com'>http://www.cnwebshow.com#">cnwebshow.com - Div CSS布局 常见问题</a></li><li><a href="cnwebshow.com'>http://www.cnwebshow.com#">cnwebshow.com - Div CSS布局 常见问题</a></li><li><a href="cnwebshow.com'>http://www.cnwebshow.com#">cnwebshow.com - Div CSS布局 常见问题</a></li><li><a href="cnwebshow.com'>http://www.cnwebshow.com#">cnwebshow.com - Div CSS布局 常见问题</a></li></ul></body></html>
Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved. 闵涛 E_mail:admin@mintao.net(欢迎提供学习资源)
鄂公网安备 42011102001154号
站长:MinTao ICP备案号:鄂ICP备11006601号-18