为什么以下CSS不起作用?
a { width: 60px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
解决方法
这是因为锚是标准的内联元素。添加显示:内嵌块将使上述代码工作。
a { width: 60px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }