我正在使用D3库和JQuery移动库,我使用D3运行一个函数来创建一系列按钮。当网页缩小时,这些按钮上的文本将脱离屏幕而不是省略号。 这是我应用于按钮的CSS:
.ui-btn{
overflow: hidden !important;
white-space: nowrap !important;
text-overflow: ellipsis !important;
}
D3功能:
var Addedbuttons = d3.select("#TheButtons").selectAll("input")
.data(data)
.enter()
.append('label')
.text(function(d) { return d; })
.append("input")
.attr("type", "radio")
.attr("name","stmntRadio");
这产生了类似的内容:
文本仍在那里,只是被浏览器隐藏了。
另一个样式正确的按钮: