Bootstrap .radio-inline 類


使用 .radio-inline 類將一系列單選按鈕控制元件顯示在同一行中。你可以嘗試執行以下程式碼,在 Bootstrap 中實現 radio-inline 類 −

示例

現場演示

<!DOCTYPE html>
<html>
   <head>
      <title>Bootstrap Forms</title>
      <meta name = "viewport" content = "width=device-width, initial-scale = 1">
      <link rel = "stylesheet" href = "https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css">
      <script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
      <script src = "https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
   </head>
   <body>
      <label for = "name">Best Porgraming Language</label>
      <div>
         <label class = "radio-inline">
            <input type = "radio" name = "optionsRadiosinline" id = "optionsRadios3" value = "option1" checked> Java
         </label>
         <label class = "radio-inline">
            <input type = "radio" name = "optionsRadiosinline" id = "optionsRadios4" value = "option2"> C
         </label>
         <label class = "radio-inline">
            <input type = "radio" name = "optionsRadiosinline" id = "optionsRadios4" value = "option3"> C++
         </label>
      </div>
   </body>
</html>

更新於:2020 年 6 月 12 日

1 千 + 次觀看

啟動你的職業生涯

完成課程獲得認證

開始
廣告
© . All rights reserved.