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 6609205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:41:27+00:00 2026-05-25T19:41:27+00:00

I’m trying to do something that must be relatively easy, but I’ve spent hours

  • 0

I’m trying to do something that must be relatively easy, but I’ve spent hours mucking around with this and I’m no getting to the answer.

I need to layout some input fields and their layers on a grid (or like a table I guess) with

lable     input      label input
label     input      label input

Because the input fields are different widths (and would look pretty crappy if they were all the same width) the best I’ve managed to get is

label     input    label  input
label     logerinput    label  input

How do I line up the second set of labels and there inputs?

I’ve made two classes for the labels

#dpi_form label { 
  display: inline-block; 
  width: 150px; 
  margin-left: 20px;
}
#dpi_form .right-label {
  display: inline-block;
  width: 150px;
  margin-left: 220px; 
}

and the associated controls are

  <label for="req_retailer_index_fld">Select the retailer*:</label><select id="req_retailer_index_fld" name="req_retailer_index_fld" class="required selectbox ui-widget-content"><option>item 1</option><option>item 2</option></select>
  <label for="req_region_index_fld" class="right-label">Select the region*:</label><select id="req_region_index_fld" name="req_region_index_fld" class="required selectbox ui-widget-content"><option>item 1</option><option>item 2</option></select><br />
  <label for="req_customer_type_index_fld">Select the customer type*:</label><select id="req_customer_type_index_fld" name="req_customer_type_index_fld" class="required selectbox ui-widget-content"><option>item 1</option><option>item 2</option></select>
  <label for="req_meter_state_index_fldi" class="right-label">Select the meter state*:</label><select id="req_meter_state_index_fld" name="req_meter_state_index_fld" class="required selectbox ui-widget-content"><option>item 1</option><option>item 2</option></select><br />

within a div.

I’ve tried absolute positioning, relative positioning, padding, all manner of right and left margins but still can’t get the result I’m after.

I can find heaps of stuff or vertical alignment of controls.. but nothing showing me how to do this one.

Any clues please?

Peter.

  • 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-05-25T19:41:28+00:00Added an answer on May 25, 2026 at 7:41 pm

    Despite my comment about using tables on your question, this is how I would do it.

    CSS:

    label,
    input {
        display: block;
    }
    label {
        padding: 4px 0 0;
    }
    .labels1 {
        float: left;
        width: 80px;
    }
    .labels2 {
        float: left;
        width: 80px;
    }
    .inputs1 {
        float: left;
        width: 200px;
    }
    .inputs2 {
        float: left;
        width: 200px;
    }
    

    HTML:

    <div class="labels1">
        <label for="input1">Input 1: </label>
        <label for="input2">Input 2: </label>
        <label for="input3">Input 2: </label>
    </div>
    
    <div class="inputs1">
        <input type="text" value="" name="input1" id="input1" />
        <input type="text" value="" name="input2" id="input2" />
        <input type="text" value="" name="input3" id="input3" />
    </div>
    
    <div class="labels2">
        <label for="input4">Input 4: </label>
        <label for="input5">Input 5: </label>
        <label for="input6">Input 6: </label>
    </div>
    
    <div class="inputs2">
        <input type="text" value="" name="input4" id="input4" />
        <input type="text" value="" name="input5" id="input5" />
        <input type="text" value="" name="input6" id="input6" />
    </div>
    

    Then you can change the labels and inputs classes to the width you want.
    Although I still think tables are easier because then you don’t have to worry about setting widths yourself; you also don’t have to worry about vertical alignment with tables.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a French site that I want to parse, but am running into
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text

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.