9
A
回答
22
我碰到的实际工作,如果任何人机会碰到这个问题又来这个其他的答案。
How to standardize the height of a select box between Chrome and Firefox?
基本上你改变元素的外观定义,那么你可以添加的风格吧。
.className {
-webkit-appearance: menulist-button;
height: 50px;
}
为我工作,但它确实改变了元素的边界。只要确保跨浏览器在更改后检查它,并确保边框样式仍然可以接受。
1
对我来说这并获得成功:
select {
font: inherit;
}
0
由于优先考虑内联样式,你可以用这种伎俩来增加你的选择列表的高度。你所要做的就是在select标签中添加内联风格。
<!-----------If you are using Bootstrap ---------->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<body>
<div class="container">
<form>
<div class="form-group">
<label for="sel1">Select list (select one):</label>
<select class="form-control" style=" height:50px;" id="sel1">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
</div>
</form>
</div>
</body>
2
我希望这对你的作品
只给一个高度的选项在样式表使您可以轻松地与期权的行数计算选择字段的高度
<style>select>option{height:20px;}</style>
并根据需要在脚本标记中添加此功能或者仅复制此文件
<script>function myFunction() {
var x = document.getElementById("mySelect").length;
var y = 20 * x +10;
document.getElementById("mySelect").style.height = y+"px";}</script>
主体部分
<body onload="myFunction()"><select id="mySelect" multiple="multiple"><option>Apple</option>option>Pear</option><option>Banana</option><option>Orange</option><option>Banana</option></select></body>
相关问题
- 1. CSS属性选择器对CSS样式高度
- 2. 如何增加Bootstrap选择下拉选项的高度
- 3. 如何增加kendo UI中选择标签的边框宽度
- 4. 从样式组中选择css样式
- 5. 如何在增加窗口高度时增加WPF中控件的高度?
- 6. css边框样式:之前选择器没有采取全高
- 7. CSS选择框箭头样式
- 8. 选择框样式通过CSS
- 9. 增加列表框的高度在IE7
- 10. 如何在asp.net中增加组合框的高度
- 11. Increass选择框的高度
- 12. jquery css高度选择器?
- 13. 如何在swift中增加uitableview的选定单元格高度?
- 14. 如何增加titelBar高度?
- 15. 如何增加高图的高度?
- 16. CSS:样式选择的选择列表
- 17. 如何样式使用HTML + CSS的选择框?
- 18. 用户如何选择CSS样式?
- 19. 如何增加Android中的ScrollView高度?
- 20. 如何增加ipad中的DatePicker高度?
- 21. 复选框的CSS样式
- 22. 如何增加文本框中的textwrap时的高度?
- 23. 如何增加复选框平均高度和宽度的大小?
- 24. 增加高度
- 25. CSS选择器样式?
- 26. CSS选择器样式
- 27. CSS高度:无法增加父类的高度?
- 28. CSS:我怎样才能使fieldset和多个选择框的高度相同?
- 29. Codename one:增加对话框的高度
- 30. 自动增加高度(html,CSS)
只需使用高度?或者,如果你想让它们更高,可以在'