html - Responsive bootstrap form not becoming responsive -
i trying build form using bootstrap , need responsive too. needs go 4 colmn layout 3 1 colmn layout deepending on width.
my code located @ http://jsfiddle.net/azmz2/1/ updated fluid still not working
you notice have 4 columns. however, when resize, doesn't become 3 column. need become 3 column , widths decreases 2 , 1 column (aka responsiveness). columns need align vertically , horizontally. not happening. doing wrong? can not seem figure out. in advance.
<form class="form-horizontal" name="submitdetails" acttion="#"> <fieldset> <div class="control-group oneline"> <label class="control-label" for="custom1">1. did telephone us?</label> <div class="controls"> <label class="radio span2" for=""> <input name="custom1" id="custom1" value="yes" checked="checked" type="radio"> yes </label> <label class="radio span2" for=""> <input name="custom1" id="custom1" value="no" type="radio"> no </label> </div> </div> <div class="control-group oneline"> <label class="control-label" for="custom2">2. how did hear us?</label> <div class="controls"> <div class="row-fluid"> <label class="radio span3" for=""> <input name="custom2" id="custom2" value="1" checked="checked" type="radio"> newspaper </label> <label class="radio span3" for=""> <input name="custom2" id="custom2" value="2" type="radio"> billboard </label> <label class="radio span3" for=""> <input name="custom2" id="custom2" value="3" type="radio"> yellow pages </label> <label class="radio span3 " for=""> <input name="custom2" id="custom2" value="4" type="radio"> radio </label> </div> <div class="row-fluid"> <label class="radio span3" for=""> <input name="custom2" id="custom2" value="5" type="radio"> google / internet </label> <label class="radio span3" for=""> <input name="custom2" id="custom2" value="23" type="radio"> white pages </label> <label class="radio span3" for=""> <input name="custom2" id="custom2" value="7" type="radio"> referral </label> <label class="radio span3" for=""> <input name="custom2" id="custom2" value="8" type="radio"> television </label> </div> <div class="row-fluid"> <label class="radio span3" for=""> <input name="custom2" id="custom2" value="9" type="radio"> familiar area </label> <label class="radio span3" for=""> <input name="custom2" id="custom2" value="10" type="radio"> magazine </label> <label class="radio span3" for=""> <input name="custom2" id="custom2" value="21" type="radio"> catalogue </label> <label class="radio span3" for=""> <input name="custom2" id="custom2" value="25" type="radio"> our website </label> </div> <div class="row-fluid"> <label class="radio inline" for=""> <input name="custom2" id="custom2" value="24" type="radio"> 1300 number </label> </div> </div> </div> <br/> <div align="right"><button>submit</button></div> </fieldset> </form> <style type="text/css"> body { background-color: #ffffff; font-family: arial, helvetica, sans-serif; font-size: 12px; max-width: 640px; margin: 0 auto; } .oneline .controls { background-color: #d8d8d8; margin:0px; display:inline-block; width:100%; } .control-group.oneline > label { float: none; text-align: left; width: 100%; } .error { color: #ff0000; } .radio.inline{ margin-bottom:auto; vertical-align: auto; } </style>
based on css using on jsfiddle, , on span2 / span3 classes, using bootstrap 2 .
unless want use custom css, version of bootstrap doesn't offer option of moving 4 3 2 1 column viewport decreases. 4 columns collapse 1 column @ viewports below 768px.
have considered using bootstrap 3?
it has replaced old .spanx classes new options .col-sm-x , .col-md-y let describe. see http://getbootstrap.com/css/#grid full details.
good luck!
Comments
Post a Comment