超出div的文字省略并显示点
html代码中,“p”文字内容必须包含在li标签内部,否则无效。
html
<div class="jy-left"> <h2><a href="[field:arcurl/]">[field:title/] <small>[field:shorttitle/]</small></a></h2> <ul> <li><p><em>招生对象:</em>[field:student/]</p></li> <li><p><em>学习内容:</em>[field:zhukecheng/]</p></li> <li><p><em>赠送特色课程:</em>[field:tekecheng/]……</p></li> </ul> </div>
css
#div ul li p{ overflow: hidden; //超出隐藏 text-overflow:ellipsis; //显示省略号 white-space: nowrap; //不换行 }