Positioning a Comment Input Field

Posted by John on Stack Overflow See other posts from Stack Overflow or by John
Published on 2010-03-29T17:30:28Z Indexed on 2010/03/29 17:33 UTC
Read the original article Hit count: 162

Filed under:

Hello,

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 has 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;
    }   

© Stack Overflow or respective owner

Related posts about css