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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:06:30+00:00 2026-06-15T12:06:30+00:00

I have been trying to edit this easy form to just look good for

  • 0

I have been trying to edit this easy form to just look good for 3 hours now and Im still not quite there. I want the input fields to be on the same row as the labels naturally, but somehow the inputs are a bit lower than the labels and I cant seem to edit them with margins. What am I doing wrong?

Heres a snaggy picture of what the form looks like:

http://snag.gy/oPRNy.jpg

// CONTACT FORM

<label for="name"><p>Name:</p></label>
<input type="text" name="name" id="name" tabindex="1" />
<br/>
<label for="email"><p>Email:</p></label>
<input type="text" name="email" id="email" tabindex="2" />
<br/>
<label for="subject"><p>Subject:</p></label>
<input type="text" name="subject" id="subject" tabindex="3" />
<br/>
<label for="comments"><p>Comments:</p></label>
<textarea name="comments" id="comments" cols="45" rows="5" tabindex="4"></textarea>
<br/>
<label for="submit"></label>
<input type="submit" name="submit" id="submit" value="Submit" tabindex="5" />
<label for="reset"></label>
<input type="reset" name="reset" id="reset" value="Clear" tabindex="6" />

// CSS

    label {
    float: none;
    font-size: 100%;
    width: 250px; /* just this width evens out input box placement */
    font-weight: bold;
}
input { /*I think these just fall in because they are naturally following the labels!*/
    width: 250px;
    padding:5px;
    margin-top: -10px;
}
textarea {
    width: 250px;
    height: 150px;
    resize:none;
}
guestbook {
    margin-top:50px;
    text-align:center;
    font-size:26px;
    color:#05924b;
    font-family:Gisha;

}
gb p {
    color:#05924b;
    font-family:Gisha;
    text-align:left;
    margin-left:85px;
    margin-top:0px;
    margin-bottom:0px;
}

// SOLUTION: Removed the “p” paragraph from within the form and adjusted the rest from CSS, added float:left to the different inputs fields and rows, lowered the label width so the input came closer, then calculated and put the correct margin-right to both input{} and textarea{} and last to #submit to get everything in nice order.
Heres a screenshot from the new code: http://snag.gy/PwpbQ.jpg

// CSS

    /* Input */
label {
    float: left;
    font-size: 100%;
    width: 50px; /* just this width evens out input box placement */
    font-weight: bold;
    margin: 2px 0;
    padding:5px;
    font-family: Gisha;
    font-style: normal;
    font-variant: normal;
    text-decoration: none;
    text-align: left;
}
input { /*I think these just fall in because they are naturally following the labels!*/
    width: 300px;
    padding:5px;
    margin: 5px 0;
    font-size:24px;
    margin-right:192px;
}
textarea {
    width: 300px;
    height: 150px;
    resize:none;
    margin:5px 0;
    padding:5px;
    margin-right:192px;
}
#submit {
    margin-right:225px; 
}
/* End of input */
  • 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-15T12:06:31+00:00Added an answer on June 15, 2026 at 12:06 pm

    Remove all of the <p> tags from the labels. A <p> tag is a block level element, therefore it should not be nested within the inline element <label>. Block level elements also clear, meaning they do not allow content on either side (unless floated). I believe this is causing your issue.

    <label for="name">Name:</label>
    <input type="text" name="name" id="name" tabindex="1" />
    <br/>
    <label for="email">Email:</label>
    <input type="text" name="email" id="email" tabindex="2" />
    <br/>
    <label for="subject">Subject:</label>
    <input type="text" name="subject" id="subject" tabindex="3" />
    <br/>
    <label for="comments">Comments:</label>
    <textarea name="comments" id="comments" cols="45" rows="5" tabindex="4"></textarea>
    <br/>
    <label for="submit"></label>
    <input type="submit" name="submit" id="submit" value="Submit" tabindex="5" />
    <label for="reset"></label>
    <input type="reset" name="reset" id="reset" value="Clear" tabindex="6" />
    

    Once the markup has been adjusted the label and input tags have no vertical spacing. To add vertical spacing you can add a margin to both elements.

    label {
        font-size: 100%;
        width: 250px;
        font-weight: bold;
        margin: 2px 0;
    }
    
    input {
        width: 250px;
        padding:5px;
        margin: 2px 0;
    }
    

    Example: http://jsfiddle.net/KZrXD/

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

Sidebar

Related Questions

There has to be a easy solution to this. I have been trying to
I have been trying to figure this out for a while now and decided
I have been trying to edit the jquery buttons in order to modify them
I have been trying for almost a week now to create an SQLite database
I have been searching for an answer to this question for some time now,
Salutations I have been trying to find a way to edit an Ember.Select box
I have been trying to parse this ( http://app.calvaryccm.com/mobile/android/v1/devos ) URL using a SAX
What I thought should have been easy has now taken great amount of my
Have been trying to encrypt an xml file to a string so that I
Have have been trying to make a validator for my xml files. I have

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.