源代碼
點擊運行
<!DOCTYPE html> <html> <head> <title>Foundation 實例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdn.staticfile.org/foundation/5.5.3/css/foundation.min.css"> <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdn.staticfile.org/foundation/5.5.3/js/foundation.min.js"></script> <script src="https://cdn.staticfile.org/foundation/5.5.3/js/vendor/modernizr.js"></script> </head> <body> <div style="padding:20px;"> <h2>圓角開關</h2> <p>使用 <code>.radius</code> 和 <code>.round</code> 類來設置圓角開關:</p> <span>默認</span> <div class="switch"> <input id="mySwitch1" type="checkbox"> <label for="mySwitch1"></label> </div> <span>圓角</span> <div class="switch radius"> <input id="mySwitch2" type="checkbox"> <label for="mySwitch2"></label> </div> <span>圓形</span> <div class="switch round"> <input id="mySwitch3" type="checkbox"> <label for="mySwitch3"></label> </div> </div> </body> </html>
運行結果