radio group bootstrap 4 code example

Example 1: bootstrap radio button

<div class="form-check">
  <input class="form-check-input" type="radio" name="exampleRadios" id="exampleRadios1" value="option1" checked>
  <label class="form-check-label" for="exampleRadios1">
    Default radio
  </label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="exampleRadios" id="exampleRadios2" value="option2">
  <label class="form-check-label" for="exampleRadios2">
    Second default radio
  </label>
</div>
<div class="form-check disabled">
  <input class="form-check-input" type="radio" name="exampleRadios" id="exampleRadios3" value="option3" disabled>
  <label class="form-check-label" for="exampleRadios3">
    Disabled radio
  </label>
</div>

Example 2: bootstrap email address validation

<form> <!--make sure you add this inside a form-->
  <div class="form-group"> <!--required to start the form container-->
    <label for="InputEmail">Email address</label> <!--"for" needs to match the "id" on the next line to bind it-->
    <input type="email" class="form-control" id="InputEmail" placeholder="Enter email"> <!--id, class, and type are required for it too look right, placeholder will edit the text inside the input box-->
    <small class="form-text">We'll never share your info.</small> <!--applies small underlining text-->
  </div>
  <div class="form-group">
    <label for="Password">Password</label>
    <input type="password" class="form-control" id="Password" placeholder="Password">
  </div>
  <div class="form-check">
    <input type="checkbox" class="form-check-input" id="Check">
    <label class="form-check-label" for="Check">Check out</label>
  </div>
  <button type="submit" class="btn btn-primary">Submit</button>
</form>

Example 3: bootstrap radio button

bootstrap radio

Tags:

Css Example