【发布时间】:2017-01-19 21:41:13
【问题描述】:
我正在使用 Jquery "tagsinput" 让用户在输入字段中创建标签。
我想垂直显示标签而不是内联。
此外,当您输入诸如“1300x1300”之类的内容时,输入似乎没有覆盖 100% 的宽度。
我该如何解决这个问题?
HTML
<table>
<tr>
<td class="oppningarTd">
<input type="text" class="oppningar" data-role="tagsinput" multiple="true" />
</td>
</tr>
</table>
CSS
.bootstrap-tagsinput {
background-color: #fff;
border: 1px;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
color: #555;
vertical-align: middle;
width: 100%;
cursor: text;
white-space: pre; //Just trying something
}
td.oppningarTd {
border: 1px solid black;
background: white;
text-align: center;
width: 200px !important;
}
input.oppningar {
width: 100% !important;
text-align: center;
}
【问题讨论】:
-
将 span 元素设为
display:block,或者浮动并清除它们。 (之后,您可能想再次删除空白,并使用边距/填充。) -
@CBroe 什么 span 元素?
-
这个脚本用来显示实际标签的那些。使用浏览器的 DOM 检查器,查看使用的元素。
标签: html css twitter-bootstrap bootstrap-tags-input