html - Bootstrap form aligned, vertical, and horizontal -
i trying make pretty form work boostrap-responsive.css mobile use. before used tables, , worked fine without bootstrap-responsive, becomes ugly when scaled down.
what i'm trying accomplish:
get headline/label each input in top(horizontal).
aligned right side(so pretty on phone).
have glyphicons prepended - makes difficult, since them can't format correctly
if unclear of want accomplish, can take @ super hightech picture describes form: http://i.imgur.com/xcvl0hp.jpg
my code half working code is:
<form class="form-vertical" ....> <fieldset> <div class="row-fluid"> <div class="span8 input-prepend"> <label class="control-label" for="title">title</label> <span class="add-on"><i id="titleicon" class="icon-minus-sign"></i></span> <input type="text" name="title" id="title" /> </div> <div></div> <div class="span2 input-prepend"> <label class="control-label" for="price">price</label> <span class="add-on"><i id="priceicon" class="icon-minus-sign"></i></span> <input type="text" id="price" name="price"/> </div> </div> <div class="controls"> <label class="control-label" for="description">description</label> <div class="input-prepend"> <span class="add-on"><i id="descriptionicon" class="icon-minus-sign"></i>/span> <textarea name="description" rows="6" class="field span6" id="descriptionfield"></textarea> </div> </div>ยจ </fieldset> </form>
i not sure formatted correctly stackoverflow(this first question) here syntax highlighting: http://pastebin.com/lzn1vbyi
i know there tons of answers similar question, prepended glyph makes none of code work. tried around 15 different approaches.
you should try form
<div class="row-fluid> <div class="span12> <form class="form-horizontal"> <div class="control-group"> <label class="control-label" for="title">title</label> <div class="controls"> <span class="add-on"><i id="titleicon" class="icon-minus-sign"></i></span> <input type="text" name="title" id="title" /> </div> </div> <div class="control-group"> <label class="control-label" for="price">price</label> <div class="controls"> <span class="add-on"><i id="priceicon" class="icon-minus-sign"></i></span> <input type="text" id="price" name="price"/> </div> </div> <div class="control-group"> <div class="controls"> <label class="checkbox"> <input type="checkbox"> remember me </label> <button type="submit" class="btn">sign in</button> </div> </div>` </form> </div> </div>
Comments
Post a Comment