我正在尝试在li标签中使用checkbox / radiobutton。我想把我的checkbox / radiobutton拉到li元素的右侧。 Webkit浏览器没有问题,但Firefox将checkbox / radiobutton移动到下一行。
我正在使用Bootstrap 3 .dropdown-menu
。
HTML
<form id="advenced-search-form" class="form" method="get" action="/search">
<div class="input-group add-bottom">
<input type="text" class="form-control" placeholder="Search...">
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-caret-down text-primary"></i>
</button>
<ul class="dropdown-menu advenced-action pull-right" role="menu">
<li class="dropdown-header">Advenced search filters</li>
<li>
<label class="text-uppercase advenced-search-label"> <strong>Clients</strong>
<input type="checkbox" value="1" id="checkbox1" class="advenced-search-checkbox">
</label>
</li>
<li>
<label class="text-uppercase advenced-search-label"> <strong>Services</strong>
<input type="checkbox" value="2" id="checkbox2" class="advenced-search-checkbox">
</label>
</li>
<li>
<label class="text-uppercase advenced-search-label"> <strong>Resources</strong>
<input type="checkbox" value="3" id="checkbox3" class="advenced-search-checkbox">
</label>
</li>
</ul>
</div>
</div>
<button type="submit" class="btn btn-info btn-5x25 add-bottom pull-right">Search <i class="fa fa-caret-right"></i>
</button>
</form>
CSS
.dropdown-menu > li > label {
display: block;
font-weight: normal;
text-decoration: none;
color: #727272;
line-height: 18px;
padding: 5px 20px;
margin: 0;
white-space: nowrap;
}
.dropdown-menu > li > label:hover, .dropdown-menu > li > label:focus {
background: #f6f6f6;
cursor:pointer;
}
/*.dropdown-menu > li > label > strong, .dropdown-menu > li > label > span {
float: right;
}*/
.dropdown-menu > li > label > input[type="radio"], .dropdown-menu > li > label > input[type="checkbox"] {
margin: 4px 0 0 0px;
float: right;
}
.dropdown-menu.advenced-action {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#e6e6e6), to(#f5f5f5));
background-image: -webkit-linear-gradient(top, #e6e6e6, 0%, #f5f5f5, 100%);
background-image: -moz-linear-gradient(top, #e6e6e6 0%, #f5f5f5 100%);
background-image: linear-gradient(to bottom, #e6e6e6 0%, #f5f5f5 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#fff5f5f5', GradientType=0);
padding-bottom: 0;
}
.dropdown-menu.advenced-action > li {
border-bottom:solid 1px #cccccc;
}
.dropdown-menu.advenced-action > li:last-child {
border-bottom: none;
}
我在Bugzilla网站上搜索了这个问题的解决方案,但我没有找到任何东西。 任何人都可以帮我解释一下这个问题吗?
答案 0 :(得分:0)
检查我的解决方案。我知道它不完美但它有效。
HTML
<label class="text-uppercase advenced-search-label">
<div class="d1"><strong>Clients</strong></div>
<div><input type="checkbox" value="1" id="checkbox1" class="advenced-search-checkbox" /></div>
</label>
CSS
.d1 {
width:100%;
float:left;
}