日期:2013-05-10  浏览次数:21028 次

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
  2. <html xmlns="http://www.w3.org/1999/xhtml"> 
  3. <head> 
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
  5. <title>CSS省略号代码</title> 
  6. <style type="text/css"> 
  7. *{ 
  8.     margin:0; 
  9.     padding:0; 
  10. body{ 
  11.     padding:10px; 
  12.     font-family:Arial; 
  13. #ididid{ 
  14.     position:relative; 
  15.     width:150px; 
  16.     height:20px; 
  17.     line-height:20px; 
  18.     text-overflow:ellipsis; 
  19.     white-space:normal; 
  20.     *white-space:nowrap; 
  21.     overflow:hidden; 
  22.     border:1px solid #999; 
  23. #ididid span{ 
  24.     position:absolute; 
  25.     top:0; 
  26.     right:0; 
  27.     display:block; 
  28.     float:left; 
  29. #ididid span:after{content:"...";} 
  30. </style> 
  31. </head> 
  32. <body> 
  33. <div id=