?
This document uses PHP Chinese website manual Release
開關(guān)是在鼠標(biāo)點(diǎn)擊(手指敲擊)下在 "On" 和 "Off" 狀態(tài)下切換:
切換開關(guān)使用 <div class="switch">
創(chuàng)建。<div>
內(nèi)添加帶有唯一 id ?的 <input type="checkbox">
,<label>
元素的 for 屬性需要與 <input type="checkbox">
的 id 相匹配:
<div?class="switch"> ??<input?id="mySwitch"?type="checkbox"> ??<label?for="mySwitch"></label> </div>實(shí)例預(yù)覽 ?
使用 .large
, .small
或 .tiny
類來設(shè)置開關(guān)大?。?/p>
<div?class="switch?large">...</div>? <div?class="switch">...</div>? <div?class="switch?small">...</div>? <div?class="switch?tiny">...</div>實(shí)例預(yù)覽 ?
使用 .radius
和 .round
類來設(shè)置圓角切換開關(guān):
<div?class="switch">...</div>? <div?class="switch?radius">...</div>? <div?class="switch?round">...</div>實(shí)例預(yù)覽 ?
可以通過設(shè)置單選按鈕(radio)來設(shè)置單個(gè)選項(xiàng)。注意: 注意各個(gè)選項(xiàng)的 name
屬性必須一致 (實(shí)例中為 "myGroup" )。
<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>實(shí)例預(yù)覽 ?
關(guān)于我們 聯(lián)系我們 留言板
手冊網(wǎng)