Align these 3 input boxes

Please see here

https://codepen.io/anon/pen/zaOyby

and scroll down to "Example tab 2 (using standard nav-tabs)"

You see how I have a dropdown, and 2 input boxes. How can I align them? the dropdown is to the left. I want all 3 to be in the center.
LVL 8
CamilliaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MishaProgrammerCommented:
May be some like this?
       <div class="col-md-12">
	<div class="form-group col-md-4">
	</div>
	<div class="form-group col-md-4">
		<select id="IdSelector" class="filterField form-control" name="ReportType">
			<option key="" value="" selected="selected">Type</option>
			<option datatype="date" key="47" value="47">Assets</option>
			<option datatype="string" key="22" value="22">Invoice</option>
			<option datatype="number" key="19" value="19">Whatever</option>
		</select>
	</div>

Open in new window

0
Julian HansenCommented:
To bring the select in line with the other inputs you need the col-md-offset-4 class
<div class="form-group col-md-4 col-md-offset-4">
  <select class="filterField form-control" name="ReportType">
    <option key="" value="" selected="selected">Type</option>
    <option datatype="date" key="47" value="47">Assets</option>
    <option datatype="string" key="22" value="22">Invoice</option>
    <option datatype="number" key="19" value="19">Whatever</option>
  </select>
</div>

Open in new window

The offset classes act as if there is another column to the left / right without there actually being one there.
2
CamilliaAuthor Commented:
Thanks, I'll try it when I get to work.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

CamilliaAuthor Commented:
Now, it looks like this
image
I added a "row" to add a space between the select and the 2 input boxes.  But I want them in 3 rows (playing around with it...if you guys don't see this. I'll post back if I figure it out)

<div class="row col-md-12">
   <div class="form-group col-md-4 col-md-offset-4">
      <select class="filterField form-control" name="ReportType">
         <option key="" value="" selected="selected">Type</option>
         <option datatype="date" key="47" value="47">Assets</option>
         <option datatype="string" key="22" value="22">Invoice</option>
         <option datatype="number" key="19" value="19">Whatever</option>
      </select>
   </div>
</div>
<div class="row col-md-12 ">
   <div class="form-group reportName ">
      @Html.LabelFor(x => x.ReportName, Normal.ReportName, new { @class = "col-sm-4 control-label" })
      <div class="col-sm-5">
         @Html.TextBoxFor(m => m.ReportName, new { @class = "form-control", autocomplete = "off" })
      </div>
      <div class="col-sm-3">
         @Html.ValidationMessageFor(m => m.ReportName)
         <span class="field-validation-error hidden">
         <span>@Normal.ReportingNameMustBeUnique</span>
         </span>
      </div>
   </div>
   <div class="form-group reportName">
      @Html.LabelFor(x => x.ReportDescription, Normal.ReportDescription, new { @class = "col-sm-4 control-label" })
      <div class="col-sm-5">
         @Html.TextAreaFor(m => m.ReportDescription, new { @class = "form-control", autocomplete = "off", placeholder = Normal.Optional })
      </div>
   </div>
</div>

Open in new window

0
CamilliaAuthor Commented:
Got it. Did this to the first row "row col-md-12 col-md-offset-4". If there's a better way, I'll change it

<div class="tab-pane active" id="1b">
   <div class="row col-md-12 col-md-offset-4">
      <div class="form-group col-md-4 col-md-offset-12">
         <select class="filterField form-control" name="ReportType">
            <option key="" value="" selected="selected">Type</option>
            <option datatype="date" key="47" value="47">Assets</option>
            <option datatype="string" key="22" value="22">Invoice</option>
            <option datatype="number" key="19" value="19">Whatever</option>
         </select>
      </div>
   </div>
   <div class="row col-md-12 ">
      <div class="form-group reportName ">
         <label class="col-sm-4 control-label" for="ReportName">Report Name</label>
         <div class="col-sm-5">
            <input autocomplete="off" class="form-control" data-val="true" data-val-length="Must be 64 characters in length or less." data-val-length-max="64" data-val-required="Field is required." id="ReportName" name="ReportName" type="text" value="">
         </div>
         <div class="col-sm-3">
            <span class="field-validation-valid" data-valmsg-for="ReportName" data-valmsg-replace="true"></span>
            <span class="field-validation-error hidden">
            <span>Report name must be unique</span>
            </span>
         </div>
      </div>
      <div class="form-group reportName">
         <label class="col-sm-4 control-label" for="ReportDescription">Report Description</label>
         <div class="col-sm-5">
            <textarea autocomplete="off" class="form-control" cols="20" data-val="true" data-val-length="Must be 256 characters in length or less." data-val-length-max="256" id="ReportDescription" name="ReportDescription" placeholder="Optional" rows="2"></textarea>
         </div>
      </div>
   </div>
</div>

Open in new window


image
0
Julian HansenCommented:
You should not combine .row and .col classes - the work in a complimentary fashion. .col adds a margin and .row adds a negative margin to compensate. When you use them together they interfere with each other.
0
CamilliaAuthor Commented:
So how can I do this correctly?
0
Julian HansenCommented:
<div class="row">
    <div class="col-md-4 col-md-offset-4">
        <select> .... </select>
    </div>
</div>
<div class="row">
   <!-- Your other controls here -->
</div>

Open in new window

etc
In the link you supplied above all I did was add the col-md-offset-4 to the markup that was already there (around the <select>) and it worked perfectly.
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CamilliaAuthor Commented:
Let me take a look.
0
CamilliaAuthor Commented:
it worked. Thanks
0
Julian HansenCommented:
You are welcome.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.