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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:33:04+00:00 2026-05-14T03:33:04+00:00

What is a good way to give the input field below the three characteristics

  • 0

What is a good way to give the input field below the three characteristics listed?

Characteristics:

-Always 30 px from the left side of the browser window.

-Always 30 px below the words “Add a comment” if no comments have been added.

-Always 30 px below the preceding comment if one or more comment(s) has (have) been added.

Thanks in advance,

John

HTML / PHP Code:

<div class="addacomment"><label for="title">Add a comment:</label></div> 
    <div class="commentbox"><input class="commentsubfield" name="title" type="title" id="title" maxlength="1000"></div> 

CSS (thusfar I have no declarations for the “commentbox” selector):

.commentsubfield { width: 390px; height: 90px; border: 1px solid #999999; padding: 5px; }   
.addacomment
    {
    position:absolute;
    width:250px;
    left:30px;
    top:180px;
    text-align: left;
    margin-bottom:3px;
    padding:0px;
    font-family:Arial, Helvetica, sans-serif;
    font-size: 12px;
    color:#000000;
    }   
  • 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-14T03:33:05+00:00Added an answer on May 14, 2026 at 3:33 am

    First off, you don’t need those <div>s. You can just add class="addacomment" to the label.

    So you’ve got this:

    <label class="addacomment" for="title">Add a comment:</label>
    <?php print $your_comments_if_any; ?> 
    <input class="commentsubfield" name="title" type="title" id="title" maxlength="1000">
    

    I’m not sure what DOCTYPE you’re using, but you get the idea. Now for the CSS:

    If you want to position something relative to the page, it’s a good idea to keep the margins of the page in mind. Assuming the default, you’ll want to set any margins or padding to 0:

    html, body {
       margin: 0;
       padding: 0;
       }
    

    Now, the positioning you’ve done on .addacomment is basically keeping you from getting the result you want. I’ve stripped out the unnecessary stuff for clarity:

    .addacomment {
        display: block; /* override the default inline display */
        margin-left: 30px; /* The 30px from the left you wanted */
        }
    

    Next, .commentsubfield only needs margins added to it:

    .commentsubfield {
        margin: 30px 0 30px 30px;
        [your other styles]
        }
    

    That should give you the following result (this is an actual screenshot from Opera 10.10 OSX), although I find separating the label from its field quite weird:

    form element positioning example http://img.skitch.com/20100329-pbyj117655wig4pfh8estxw9me.jpg

    I would recommend keeping the input and corresponding label together.

    Hope I understood your question correctly, and hope this helps.

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

Sidebar

Related Questions

Is there a good way to keep keys from conflicting when using the Microsoft
What is a good way to arrange images in the footer as shown in
Wondering what the best / good way of doing this would be in jQuery.
Question What is a good way of assigning a default value to an optional
Anyone knows a good way to use http live streaming tools on non-Mac platforms?
What is a good way to represent finite automaton in Haskell? How would the
What is a good way of writing something like this in one line. The
Is there a good way to start at a given index and move BACKWARDS
What is a good way to persist querystring values in asp.net mvc? If I
Judging from the title, I kinda did my program in a fairly complicated way.

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.