No hacking !, Using bootstrap2:
<div class="control-group"> <label class="control-label"> User role</label> <div class="controls"> <label class="radio"> <input type="radio" name="user[role]" id="user_role_managing_editor" value="Managing editor" checked> Managing editor </label> <label class="radio"> <input type="radio" name="user[role]" id="user_role_area_editor" value="Area editor"> Area editor </label> <label class="radio"> <input type="radio" name="user[role]" id="user_role_author_or_referee" value="Author or referee"> Author/referee </label> </div> </div>
Demo: http://jsfiddle.net/GX6q4/1/
Update: here is Bootstrap3 version:
<legend>New user</legend> <form accept-charset="UTF-8" action="#" class="form-horizontal" id="new_user" method="post"> <div class="form-group"> <label class="col-xs-2 control-label" for="user_affiliation">Affiliation</label> <div class="col-xs-10"> <input class="form-control" id="user_affiliation" name="user[affiliation]" size="30" type="text" /> </div> </div> <div class="form-group"> <label class="col-xs-2 control-label">User role</label> <div class="col-xs-10"> <div class="radio"> <label> <input type="radio" name="user[role]" id="user_role_managing_editor" value="Managing editor" checked>Managing editor </label> </div> <div class="radio"> <label> <input type="radio" name="user[role]" id="user_role_area_editor" value="Area editor">Area editor </label> </div> <div class="radio"> <label> <input type="radio" name="user[role]" id="user_role_author_or_referee" value="Author or referee">Author/referee </label> </div> </div> </div> </form>
Demo: http://jsfiddle.net/24sx72mn/1/
Boot version 4:
<legend>New user</legend> <form accept-charset="UTF-8" action="#" id="new_user" method="post"> <div class="form-group row"> <label class="col-sm-2 col-form-label" for="user_affiliation">Affiliation</label> <div class="col-sm-10"> <input class="form-control" id="user_affiliation" name="user[affiliation]" type="text" /> </div> </div> <div class="form-group row"> <label class="col-sm-2 col-form-label">User role</label> <div class="col-sm-10"> <div class="form-check"> <input type="radio" class="form-check-input" name="user[role]" id="user_role_managing_editor" value="Managing editor" checked> <label class="form-check-label" for="user_role_managing_editor"> Managing editor </label> </div> <div class="form-check"> <input type="radio" class="form-check-input" name="user[role]" id="user_role_area_editor" value="Area editor"> <label class="form-check-label" for="user_role_area_editor"> Area editor </label> </div> <div class="form-check"> <input type="radio" class="form-check-input" name="user[role]" id="user_role_author_or_referee" value="Author or referee"> <label class="form-check-label" for="user_role_author_or_referee"> Author/referee </label> </div> </div> </div> </form>
Demo: http://jsfiddle.net/p8wyd7s8/1/
source share