下面介绍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 xml:lang="zh" lang="zh"> <head profile="http://www.w3.org/2000/08/w3c-synd/#"> <meta http-equiv="content-language" content="zh-cn" /> <meta http-equiv="content-type" content="text/html;charset=gb2312" /> <title>blueidea</title> <style type="text/css"> li { width:200px; white-space:nowrap; text-overflow:ellipsis; -o-text-overflow:ellipsis; overflow: hidden; } </style> </head> <body> <ul> <li><a href="#">web标准常见问题大全web标准常见问题大全</a></li> <li><a href="#">web标准常见问题大全web标准常见问题大全</a></li> <li><a href="#">web标准常见问题大全web标准常见问题大全</a></li> <li><a href="#">web标准常见问题大全web标准常见问题大全</a></li> <li><a href="#">web标准常见问题大全web标准常见问题大全</a></li> </body> </html>