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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:04:00+00:00 2026-05-30T11:04:00+00:00

im coding up a HTML form just now and i havinfg a little trouble

  • 0

im coding up a HTML form just now and i havinfg a little trouble aligning the comments field to the right of the text fields.

I have 3 text fields under each other and i want to have the comments text field aligned to the right of them, ive tried floating it right and then giving it a negative top margin to move it up inline but the label text which reads ‘comments’ isnt floating with the text fields as it doesnt have a class

Ive also tried separating them with 2 table cells but that doesnt help as when i want to view in mobile via the responsive layout i can move the comments field as it stuck in the table cell

Here’s the example of the floated code i tried

    <style type="text/css">
    ![enter image description here][1]<!--
    body {
background-color: #FFF;
    }

    #form {
width:960px;
background-color:#edf8ff;
height:650px;
    }

    .gezza-form {
width:894px;
margin:0 auto;
margin-top:20px;
    }

    .gezza-field {
width:437px;
height:75px;
margin-bottom:10px;
border: 1px solid #d9e7f1;
    }

    .gezza-comments{
width:437px;
height:300px;
float:right;
margin-top:-80px;
    }

    -->
    </style></head>

    <body>


    <div id="form">

    <form action="" class="gezza-form" method="post" >
    First Name<br />
    <input name="firstname" type="text" class="gezza-field" /><br/>
    Last Name<br />
    <input name="lastname" type="text" class="gezza-field" /><br/>
    Email Address<br />
    <input name="email" type="text" class="gezza-field" />
    Comments<textarea name="comments" cols="" rows="" class="gezza-comments" ></textarea>
    </form>


    </div><!-- close form -->

Here’s what im trying to achieve

[1]: https://i.stack.imgur.com/g3yO8.png VIEW IMAGE

  • 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-30T11:04:01+00:00Added an answer on May 30, 2026 at 11:04 am

    Remove margin-top:-80; float:right from the comment box style and put the comment box inside a div, before the other fields of the form. Float the div to the right. See the sample code shown below:

    <style type="text/css">
        ![enter image description here][1]<!--
        body {
    background-color: #FFF;
        }
    
        #form {
    width:960px;
    background-color:#edf8ff;
    height:650px;
        }
    
        .gezza-form {
    width:894px;
    margin:0 auto;
    margin-top:20px;
        }
    
        .gezza-field {
    width:437px;
    height:75px;
    margin-bottom:10px;
    border: 1px solid #d9e7f1;
        }
    
        .gezza-comments{
    width:437px;
    height:300px;
        }
    
        -->
        </style></head>
    
        <body>
    
    
        <div id="form">
    
        <form action="" class="gezza-form" method="post" >
        <div style="float:right;">Comments<br /><textarea name="comments" cols="" rows="" class="gezza-comments" ></textarea></div>
        First Name<br />
        <input name="firstname" type="text" class="gezza-field" /><br/>
        Last Name<br />
        <input name="lastname" type="text" class="gezza-field" /><br/>
        Email Address<br />
        <input name="email" type="text" class="gezza-field" />
    
        </form>
    

    It works in my pc and should work in mobile.

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

Sidebar

Related Questions

im coding up a HTML form just now and i havinfg a little trouble
Here's my problem: I have a form in index.html, it will have a text
Is there a coding standard for HTML? Please suggest links that have the coding
I'm just curious if I'm doing this right. I'm coding a private section of
I really have trouble with OO coding in js. I have written a piece
I have this html form which calls a php file . The index.html ->
I have been banging my head against this for a little while now. I
What is the difference with hand-coding the <form> HTML v.s. using library to generate
I'm new to HTML coding and I know HTML has some reserved characters for
How can we write html tidy coding only for inserting closing tag in the

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.