javascript - Jquery Mobile——如何覆盖选择框的高度和宽度。

标签 javascript jquery html css

<select id="selectId" name="name1" style="height:10% !important;" >
    <option>Select One</option>
    <option>xxx</option>
    <option>yyy</option>
    <option selected="selected">rrr</option>
    <option>ggg</option>
    <option>fff</option>
    <option>qqq</option>
</select>

如何设置选择的宽度和高度。我正在使用 jquery 移动 css,我无法完成这项工作。请帮助我

提前致谢

最佳答案

您需要更改此 css 类 .ui-select 试试这个:

.ui-select{
  width:200px;
  height:70px;
}

检查 Demo

如果您只想影响那个选择,请在 Jquery 中使用 id 来定位它:

$(document).ready(function(){
  $('#selectId').closest('.ui-select').addClass('select_small')
})

有了这个你可以添加这个类:

.select_small{
  width:200px;
  height:70px;
}

检查另一个 DEMO

关于javascript - Jquery Mobile——如何覆盖选择框的高度和宽度。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21259185/

相关文章:

javascript - 查找并替换 HTMLelement.INNERHTML?

javascript - 输入文件类型隐藏

javascript - jQuery 函数 .on() 不适用于 "click"事件

jquery - 我正在尝试通过悬停在 jQuery 上切换我的类(class)。为什么 CSS 没有改变?

html - CSS 无法让悬停状态在简单的 div 上运行

javascript - 自动生成下拉列表

javascript - javascript英语到阿拉伯语和其他语言的转换

javascript - 将键/值对添加到返回的 Mongoose 对象

jquery - 将表单/删除按钮与其他按钮对齐

HTML 流体列