white-space: nowrap;

div是固定宽度,想要让a标签不折行

<div>

<a href="#">测试</a><a href="#">测试</a><a href="#">测试</a><a href="#">测试</a><a href="#">测试</a><a href="#">测试</a><a href="#">测试</a>

</div>

css部分:

div{

  width:200px;

  overflow:hidden;

}

a{

  float:left;

  white-space:nowrap;

}

posted @ 2017-06-19 17:12  yewook  阅读(168)  评论(0编辑  收藏  举报