我在使用 SelectBoxIt.js 创建 100% 宽度的选择框时遇到了一些问题
即使将 CSS 宽度设置为 100%,选择框也不会 100% 填充容器元素。
CSS:
.test1, .test2, .test2 .selectboxit, .test2 .selectboxit-options {
width: 100%;
}
HTML:
<select name="test2" class="test2">
<option value="SelectBoxIt is:">SelectBoxIt is:</option>
<option value="a jQuery Plugin">a jQuery Plugin</option>
<option value="a Select Box Replacement">a Select Box Replacement</option>
<option value="a Stateful UI Widget">a Stateful UI Widget</option>
</select>
最佳答案
js
$(".mySelect").selectBoxIt({ autoWidth: false });
然后是CSS
.selectboxit-container {
width: 100%;
}
.selectboxit-container .selectboxit {
width: 100%;
}
关于javascript - 如何使用 SelectBoxIt.js 创建 100% 宽度的选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18269428/