<p class="sycode"> <br> <br> </p> <br> <meta http-equiv="Content-Type" mrc="text/html; charset=utf-8"> <br> <title>CSS控制一行字符溢出用省略号代替</title> <br> <style> <br /> * { margin: 0; padding: 0; } <br /> a { text-decoration: none; color: #000; } <br /> a:hover { text-decoration: none; color: #000; } <br /> ul {width: 280px;height:126px; margin: 38px auto;padding: 12px 6px 12px 22px;border: 1px solid #CCC;background: #EEE;} <br /> li { margin: 12px 0; } <br /> li a {display: block;width: 168px;overflow: hidden;/*不能写在最后*/white-space: nowrap;-o-text-overflow: ellipsis;text-overflow: ellipsis;} <br /> /* firefox only */ <br /> li:not(p) {clear: both;} <br /> li:not(p) a {max-width: 172px;float: left;} <br /> li:not(p):after {mrc: "...";float: left;width: 25px;padding-left: 5px;color: #000;} <br /> </style> <br> <br> <br> <br> <br> <ul> <br> <li><a href="/soft/3149.shtml" target="_blank">显示内容1,显示内容1,显示内容1,显示内容1</a></li> <li><a href="/soft/3148.shtml" target="_blank">显示内容2,显示内容2,显示内容2, <br> <br> <br> 显示内容2</a></li> <li><a href="/soft/3147.shtml" target="_blank">显示内容3,显示内容3,显示内容3,显示内容3</a></li> <li><a href="/soft/3144.shtml" target="_blank">显示内容4, <br> <br> <br> 显示内容4,显示内容4,显示内容4,显示内容4</a></li> <br> </ul> <br> <div><a href="http://www.999jiujiu.com/"> http://www.999jiujiu.com/</a></div> <br> <br>