截断列表项内的x-overflow

时间:2019-05-18 21:59:24

标签: html css twitter-bootstrap-3

是否有一种方法可以使列表中的长名称(类text-overflow: ellipsis;)漂亮的name工作,并添加到此CSS和HTML中?请注意,最后一次将55026 ID如何以丑陋的方式包裹在下面。

.my-list {
  width: 275px;
}
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" />

<ul class="list-group my-list">
  <li class="preferred-payer list-group-item">
    <label class="checkbox-inline">
			<input id="option-one" type="checkbox" name="select" value="60054">
			<span class="name">Item Name One</span>
		</label>
    <span class="id pull-right">60054</span>
  </li>
  <li class="preferred-payer list-group-item">
    <label class="checkbox-inline">
			<input id="option-one" type="checkbox" name="select" value="00562">
			<span class="name">Item Name Two</span>
		</label>
    <span class="id pull-right">00562</span>
  </li>
  <li class="preferred-payer list-group-item">
    <label class="checkbox-inline">
			<input id="option-one" type="checkbox" name="select" value="55026">
			<span class="name">A Really Long Item To Truncate </span>
		</label>
    <span class="id pull-right">55026</span>
  </li>
</ul>

1 个答案:

答案 0 :(得分:2)

您可以考虑使用from sklearn.metrics import classification_report from sklearn.metrics import confusion_matrix from sklearn.metrics import accuracy_score ..... model.fit(Xtrain, Ytrain) y_pred = model.predict(Xtest) print(accuracy_score(Ytest, y_pred)) print(confusion_matrix(Ytest, y_pred)) print(classification_report(Ytest, y_pred)) / row配置,然后添加col截断文本:

overflow:hidden
.my-list {
  width: 275px;
  padding: 0 15px;
}

.my-list>.row {
  margin: 0;
}

label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}