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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:43:08+00:00 2026-05-28T00:43:08+00:00

I want to create a form so there is text on the left side

  • 0

I want to create a form so there is text on the left side and the inputs on the right, currently I am doing

<div id="labels">
<ul>
<li>The Label</li>
</ul>
</div>

<div id="inputs">
<ul>
<li><input type="text /></li>
</ul>
</div>

And the CSS

input[type=text] {
    height: 14px;
}

#labels {
    float: left;
}

#inputs {
    float: right;
}

li {
    padding-top: 4px;
    padding-left: 10px;
}

// Text size is 14px

What happens is that the text and fields are not aligned perfectly (the inputs get progressively lower as I add items). I am thinking this is because not all the inputs can be 14px (I use drop downs, checkboxes, radios, etc.).

What would be the correct way to create this? I know a table would fix the problem but is that semantic?

  • 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-28T00:43:08+00:00Added an answer on May 28, 2026 at 12:43 am

    This sort of question has been asked multiple times here in SO, you can do a simple search and find many solutions.

    But here is a simple form to get you started:

    HTML

    <form>
        <div class="line">
            <label for="input">Full Name</label>
            <div class="input">
                <input type="text" size="30" name="input">
            </div>
        </div>
        <div class="line">
            <label for="input">Company</label>
            <div class="input">
                <input type="text" size="30" name="input">
            </div>
        </div>
        <div class="line">
            <label for="nselect">Dropdown Menu</label>
            <div class="input">
                <select name="select">
                    <option>1</option>
                    <option>2</option>
                    <option>3</option>
                    <option>4</option>
                    <option>5</option>
                </select>
            </div>
        </div>
        <div class="line">
            <label for="input">Text 1</label>
            <div class="input">
                <input type="text" size="30" name="input">
            </div>
        </div>
        <div class="line">
            <label for="input">Text 2</label>
            <div class="input">
                <input type="text" size="30" name="input">
            </div>
        </div>
        <div class="line">
            <label for="input">Text 3</label>
            <div class="input">
                <input type="text" size="15" name="input">
            </div>
        </div>
    </form>
    

    CSS

    form {
        margin:10px 0;
    }
    
    label {
        color: #404040;
        float: left;
        font-size: 13px;
        line-height: 18px;
        padding-top: 6px;
        text-align: right;
        width: 130px;
    }
    
    label, input, select, textarea {
        font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
        font-size: 13px;
        font-weight: normal;
        line-height: normal;
    }
    
    input, textarea, select {
        -moz-border-radius: 3px 3px 3px 3px;
        border: 1px solid #CCCCCC;
        color: #808080;
        display: inline-block;
        font-size: 13px;
        height: 18px;
        line-height: 18px;
        padding: 4px;
        width: 210px;
    }
    
    select {
        height: 27px;
        line-height: 27px;
    }
    
    form .input {
        margin-left: 150px;
    }
    
    form .line {
        margin-bottom: 18px;
    }
    

    Here is a demo: http://jsfiddle.net/5aduZ/1/

    A lot of people will not agree with my use of divs to separate the form elements but through testing i found this format to be the safest and surefire way to go about it as it separates the fields cleanly, and it works just fine under IE. Plus, it is the format used by the big boys (facebook, twitter, google).

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

Sidebar

Related Questions

I want to create a form which has a text entry box where a
I want to create a javascript form that basically has a bunch of text
i want to create a small c# application. there is a text box and
I want to create a customized Ext.form.field.Field with a gray text color if the
I want to create a simple user registration form with First / Last name,
I want to create fixed status bar in by web form to display various
I'm making a simple form to create polls, therefore I want the possibility to
Hello there i'm trying to create a form with Zend_Form that will enable my
I want to create a search bar like one in this page http://dl.dropbox.com/u/333492/search/form.html If
Ok so I want to know how <% using (Html.BeginForm()) { %> <input type=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.