吳裕雄 Bootstrap 前端框架開發——Bootstrap 表單:復選框(Checkbox)和單選框(Radio)


<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8"> 
        <title>Bootstrap 實例 - 復選框和單選按鈕</title>
        <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">  
        <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
        <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    </head>
    <body>

        <label for="name">默認的復選框和單選按鈕的實例</label>
        <div class="checkbox">
            <label><input type="checkbox" value="">選項 1</label>
        </div>
        <div class="checkbox">
            <label><input type="checkbox" value="">選項 2</label>
        </div>
        <div class="radio">
            <label>
                <input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked> 選項 1
            </label>
        </div>
        <div class="radio">
            <label>
                <input type="radio" name="optionsRadios" id="optionsRadios2" value="option2">選項 2 - 選擇它將會取消選擇選項 1
            </label>
        </div>
        <label for="name">內聯的復選框和單選按鈕的實例</label>
        <div>
            <label class="checkbox-inline">
                <input type="checkbox" id="inlineCheckbox1" value="option1"> 選項 1
            </label>
            <label class="checkbox-inline">
                <input type="checkbox" id="inlineCheckbox2" value="option2"> 選項 2
            </label>
            <label class="checkbox-inline">
                <input type="checkbox" id="inlineCheckbox3" value="option3"> 選項 3
            </label>
            <label class="radio-inline">
                <input type="radio" name="optionsRadiosinline" id="optionsRadios3" value="option1" checked> 選項 1
            </label>
            <label class="radio-inline">
                <input type="radio" name="optionsRadiosinline" id="optionsRadios4"  value="option2"> 選項 2
            </label>
        </div>

    </body>
</html>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM