Select2 4.0.0 Bootstrap theme

最后都变了- 提交于 2019-12-01 17:23:44

@fk is working on a Bootstrap 3 theme for Select2 4.0.0.

https://github.com/select2/select2-bootstrap-theme

There is not currently any documentation on creating themes for Select2 4.0.0, but it may help to look at the default theme's SCSS for the selectors.

If you want to use bootstrap styling from Kevin Brown' answer

https://github.com/select2/select2-bootstrap-theme

You add this css file to your page, keep the default select2 styles

<link href="/select2-bootstrap-theme/select2-bootstrap.min.css" type="text/css" rel="stylesheet" />

Then set the theme

$("#elem").select2({theme:"bootstrap"});

Also, use classes .select2-bootstrap-prepend and .select2-bootstrap-append on the .input-group wrapper elements to group buttons and selects seamlessly.

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