1、根据自己的需求编写好模块(如果你不是新手,直接看第二步!)HTML代码:<div class="demo"><p>内容</p></div>CSS代码:.demo{ width: 300px; height: 30px; line-height: 30px; border: 1px solid #ddd; border-radius: 3px; margin: 50px auto; padding: 0 10px; }

2、设置单行文本超出范围后隐藏溢出并增加省略号...CSS代码:.texthide{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
