javascript - How to place month, date, year of f.date_select on single line? -


i have view new.html.erb

<div class="container">       <div class="row"> <div class="col-md-4 col-md-offset-4"> . . <%= f.label :date_of_birth %><br /> <%= f.date_select :date_of_birth, { :start_year => 1920, :end_year => 2010 }, :class => 'form-control date-select' %> . . </div> </div> </div> 

the view new.html.erb gets displayed follows

enter image description here

i using twitter bootstrap , not using devise gem.
there way can display 3 listboxes on same line?

your selectboxes have form-control class defines width: 100% , display: block. means makes them take same line should wrap selectboxes 1 more container , make them inline/inline-block , set width:

<div class="col-md-4 col-md-offset-4">     ...     <label>date of birth</label>      <div>         <select name="date_of_birth" class="form-control date-select"></select>         <select name="month_of_birth" class="form-control date-select"></select>         <select name="day_of_birth" class="form-control date-select"></select>     </div>     ... </div> 

and define css styles .date-select class:

.date-select {      display: inline-block;     width: 30%; } 

illustration: http://plnkr.co/edit/00izoqhm3nfquniefnwe?p=preview


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -