如何将复选框附加到按钮组? (Bootstrap 3)
How to append a checkbox to a button group? (Bootstrap 3)
我被迫使用 bootstrap 3. 我需要将一个复选框(带有文本)附加到按钮组。
但是,class="input-group-addon"
似乎没有产生预期的结果
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<div class="input-group-btn">
<label class="input-group-addon">
<input type="checkbox">
Auto Draw
</label>
<button class="btn">Button1</button>
<button class="btn">Button2</button>
<button class="btn">Button3</button>
</div>
</div>
</div>
</div>
是否有不同的 class 将内容附加到按钮组?
这似乎与您预期的类似。我将容器包裹在 "input-group" class 中。 https://getbootstrap.com/docs/3.4/components/#input-groups-basic
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<div class="input-group">
<label class="input-group-addon">
<input type="checkbox">Auto Draw</label>
<div class="input-group-btn">
<button class="btn">Button1</button>
<button class="btn">Button2</button>
<button class="btn">Button3</button>
</div>
</div>
</div>
</div>
</div>
我被迫使用 bootstrap 3. 我需要将一个复选框(带有文本)附加到按钮组。
但是,class="input-group-addon"
似乎没有产生预期的结果
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<div class="input-group-btn">
<label class="input-group-addon">
<input type="checkbox">
Auto Draw
</label>
<button class="btn">Button1</button>
<button class="btn">Button2</button>
<button class="btn">Button3</button>
</div>
</div>
</div>
</div>
是否有不同的 class 将内容附加到按钮组?
这似乎与您预期的类似。我将容器包裹在 "input-group" class 中。 https://getbootstrap.com/docs/3.4/components/#input-groups-basic
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<div class="input-group">
<label class="input-group-addon">
<input type="checkbox">Auto Draw</label>
<div class="input-group-btn">
<button class="btn">Button1</button>
<button class="btn">Button2</button>
<button class="btn">Button3</button>
</div>
</div>
</div>
</div>
</div>