Bootstrap selectpicker search box font size

依然范特西╮ 提交于 2020-01-06 05:40:10

问题


Is it possible to change font size of the search box in Bootstrap select?

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<select class="selectpicker" data-live-search="true">
    <option>Option 1</option>
    <option>Option 2</option>
</select>


回答1:


Bootstrap-Select generates some HTML for you, so the thing you want is to inspect the HTML and then write some CSS to override the attributes given by the library.

CSS:

.bs-searchbox > input {
  font-size: 20px;
}

This should work for you. Hope this answers your question.




回答2:


Do you mean like this?

.selectpicker{
  font-size: 15px !important;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<select class="selectpicker" data-live-search="true">
    <option>Option 1</option>
    <option>Option 2</option>
</select>



回答3:


If you are using Bootstrap-Select, then you can use the following css:

.filter-option {
    font-size: 30px;
}


来源:https://stackoverflow.com/questions/46152433/bootstrap-selectpicker-search-box-font-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!