Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8539409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:21:32+00:00 2026-06-11T11:21:32+00:00

How to align 2 collection dropdown’s in simple_form and make them inline [ drop

  • 0

How to align 2 collection dropdown’s in simple_form and make them inline [ drop 1] [ drop 2]

The example on :

http://simple-form-bootstrap.plataformatec.com.br/articles/new

Shows how to align checkboxes and radiobuttions,
but im unable no matter what I try to align 2 collection dropdowns inline after each other.

Tried all solutions I could find here and online with wrapper inline, class inline etc. nothing works 🙁

= f.input :age_from,
            :collection => 18..60,
            :selected => 18,
            :label => 'Age from',
            :style => "width: 85px !important"

  = f.input :age_to,
            :collection => 18..60,
            :selected => 55,
            :label => 'Age to',
            :style => "width: 85px !important"

HTML:

        <form accept-charset="UTF-8" action="/sessions" class="simple_form form-horizontal" id="new_session" method="post" novalidate><div style="margin:0;padding:0;display:inline"></div>
          <div class="control-group select required"><div class="controls"></div></div>
          <div class='ruler'></div>
          <div class="control-group select optional"><label class="select optional control-label" for="session_age_from">Age from</label><div class="controls"><select class="select optional" id="session_age_from" name="session[age_from]"><option value="18" selected="selected">18</option>

          <option value="60">60</option></select></div></div>
          <div class="control-group select optional"><label class="select optional control-label" for="session_age_to">Age to</label><div class="controls"><select class="select optional" id="session_age_to" name="session[age_to]"><option value="18">18</option>

          <option value="55" selected="selected">55</option>
          <option value="60">60</option></select></div></div>
          <div class='ruler'></div>
          <div class="control-group string optional"></div>
        </form>

CSS:

.form-search input, .form-search textarea, .form-search select, .form-search .help-inline, .form-search .uneditable-input, .form-search .input-prepend, .form-search .input-append, .form-inline input, .form-inline textarea, .form-inline select, .form-inline .help-inline, .form-inline .uneditable-input, .form-inline .input-prepend, .form-inline .input-append, .form-horizontal input, .form-horizontal textarea, .form-horizontal select, .form-horizontal .help-inline, .form-horizontal .uneditable-input, .form-horizontal .input-prepend, .form-horizontal .input-append {
    display: inline-block;
    margin-bottom: 0;
    vertical-align: middle;
}
select {
    background-color: #FFFFFF;
    border-style: solid;
    border-width: 1px;
}
select {
    margin: 0.5em 0;
}
select {
    background-color: #FFFFFF;
    border: 1px solid #BBBBBB;
    width: 220px;
}
select, input[type="file"] {
    height: 30px;
    line-height: 30px;
}
select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input {
    border-radius: 3px 3px 3px 3px;
    color: #555555;
    display: inline-block;
    font-size: 14px;
    height: 20px;
    line-height: 20px;
    margin-bottom: 9px;
    padding: 4px 6px;
}
input, button, select, textarea {
    font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
}
label, input, button, select, textarea {
    font-size: 14px;
    font-weight: normal;
    line-height: 20px;
}
button, input, select, textarea {
    font-size: 100%;
    margin: 0;
    vertical-align: middle;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T11:21:33+00:00Added an answer on June 11, 2026 at 11:21 am

    One option is to just use the bootstrap layout div tags like so to align them. I use span3 bc my total form is span6 but you can modify that as you need.

    <div class="row">
        <div class="span3"><%= f.input :age_from, :collection => 18..60, :selected => 18, :label => 'Age from', :style => "width: 85px !important" %></div>
        <div class="span3"><%= f.input :age_to, :collection => 18..60, :selected => 55, :label => 'Age to', :style => "width: 85px !important" %></div>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I align the bottom of an inline block (call it 'IB') with
I am using text-align:justify to evenly space out inline-block elements. I am using jQuery
page_form.php echo '<div style=text-align:center;margin-left:25px;> <form action=grad.php method=post> <table width-100%> <tr><th style=padding:12px;>LETTER </th> <th style=padding:12px;>INTERVAL</th>
How can I: right-align the text in the ID column make each of the
Dear All, View <form align=center name=gm action=> <label for=col1><b>Name: </b></label> <%= collection_select(@table, gm, @pop1,
Based on this Adobe multiple axis chart example: http://livedocs.adobe.com/flex/3/html/help.html?content=charts_types_12.html Then I changed some data
How do I get radio buttons to align horizontally? for example: <%= f.input :rating,
I want to align the buttons as shown bellow, for this, I used relative
How can I center align (horizontally) an image inside its container div? Here's the
I want align the div to center. like this I have tried margin-top, vertical-align

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.