내가 이것을 시도했습니다과 같은 방법으로보고 선택 2 스타일을 변경해야합니다 : 그것은 http://jsfiddle.net/crxepevy/1/ 잘 작동?
JS
var data = [{
id: 0,
text: 'enhancement'
}, {
id: 1,
text: 'bug'
}, {
id: 2,
text: 'duplicate'
}, {
id: 3,
text: 'invalid'
}, {
id: 4,
text: 'wontfix'
}];
$(".js-example-data-array").select2({
data: data,
theme: "themes-dark"
});
CSS
<body>
<nav class="mainmenu">
<div class="container">
<div class="navbar-right">
<select class="js-example-data-array themes-dark"></select>
<button type="button" class="navbar-toggle"><font color="white"><i class="fa fa-search fa-lg fa-fw"></i></font>
</button>
<button type="button" class="navbar-toggle"><font color="white"><i class="fa fa-play fa-lg fa-fw"></i></font>
</button>
<button type="button" class="navbar-toggle"><font color="white"><i class="fa fa-vk fa-lg fa-fw"></i></font>
</button>
</div>
</div>
</nav>
CSS
html {
background:#505D6E url(http://habrastorage.org/files/a01/ca3/b36/a01ca3b360454f539b4275a3ad274c87.jpg) no-repeat center center fixed;
min-height:100%;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover; }
body {
background:transparent;
min-height:100%;
-webkit-font-smoothing: antialiased;
-webkit-overflow-scrolling: touch;
line-height: 1.5em;
font-size:14px;
font-family: Helvetica, Arial, sans-serif;
color:#fff;
color:rgba(255,255,255,.8);
font-weight: normal;
}
.mainmenu { z-index: 999999; width:100%; padding: 30px 0 0 0;}
@media (min-width: 768px) {
.mainmenu { position: fixed; }
}
.navbar-toggle, .themes-dark, .select2-container--themes-dark {
position:relative;
display:block;
padding: 9px 10px;
background: rgba(0, 0, 0, 0.2);
background-image: none;
border: 0 none;
top:0px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
outline: 0;
opacity: 1;
-webkit-transition: all .45s;
-moz-transition: all .45s;
transition: all .45s;
float: left;
}
select {
height: 39px !important;
width: 100px;
margin: 8px 20px !important;
}
span.select2.select2-container.select2-container--themes-dark.select2-container--below, .select2-container--themes-dark {
margin-right: 20px !important;
margin-top: 8px;
height: 39px;
}
01,
선택 2는 자신의 HTML을 추가 그래서 잘못된 HTML을 스타일링하는 경우 할 수있다. 어떤 요소가 생성되었는지 보려면 Browsertool을 사용하십시오. – Fuzzyma
http://jsfiddle.net/crxepevy/2/이게 당신이 찾고있는 것입니까? 컨테이너와 그 컨테이너를 모두 추가 할 수 있습니다. select2 클래스를 편집하십시오. 전 단지 구조를 사용하고 자신의 규칙 ontop 적용. 우리 모두가 them2를 기다리고 있습니다 select2 of – Persijn
@Persijn, 네, 이것이 제가 필요한 것입니다. 나는 또한 드롭 다운 목록 회색/반투명 싶었어요. Btw, select2 현재 스타일로 글꼴이 흰색입니다. 즉, 입력 한 내용을 볼 수 없습니다. –