Container for checkboxes in Bootstrap


Add checkbox to a web page with Bootstrap, using the .checkbox class in Bootstrap

You can try to run the following code to set container for checkboxes −

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <title>Bootstrap Example</title>
      <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet">
      <script src = "/scripts/jquery.min.js"></script>
      <script src = "/bootstrap/js/bootstrap.min.js"></script>
   </head>
   <body>
      <div class = "container">
         <h2>Programming Survey</h2>
         <p>Which programming languages do you like?</p>
         <form>
            <div class = "checkbox">
               <label><input type = "checkbox" value = " ">Java</label>
            </div>
            <div class = "checkbox">
               <label><input type = "checkbox" value="">C++</label>
            </div>
            <div class = "checkbox">
               <label><input type = "checkbox" value="">C</label>
            </div>
         </form>
      </div>
   </body>
</html>

Updated on: 12-Jun-2020

418 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements