The switch is switched in the “On” and “Off” states with a mouse click (finger tap):
切换开关使用 尝试一下 » Use 尝试一下 » You can set a single option by setting the radio button (radio). 注意: Pay attention to the
<div
class="switch">
创建。
<div>
内添加带有唯一 id 的
<input
type="checkbox">
,
<label>
元素的 for 属性需要与
<input
type="checkbox">
的 id 相匹配: 8.25.1. Example ¶
<div class="switch">
<input id="mySwitch" type="checkbox">
<label for="mySwitch"></label>
</div>
8.25.2. Example ¶
<div class="switch large">...</div>
<div class="switch">...</div>
<div class="switch small">...</div>
<div class="switch tiny">...</div>
Fillet switch ¶
.radius
And
.round
Class to set the fillet switch: 8.25.3. Example ¶
<div class="switch">...</div>
<div class="switch radius">...</div>
<div class="switch round">...</div>
Switch group ¶
name
Property must be consistent (“myGroup” in the instance). 8.25.4. Example ¶
<div class="switch">
<input id="mySwitch1" type="radio" name="myGroup">
<label for="mySwitch1"></label>
</div>
<div class="switch">
<input id="mySwitch2" type="radio" name="myGroup" checked>
<label for="mySwitch2"></label>
</div>