How do I set the height and width of a comments box like this...
Code CSS:<li> <label for="comments"> Comments: </label> <input id="comments" name="comments" class="text" type="text" /> </li>
Debbie
| SitePoint Sponsor |





How do I set the height and width of a comments box like this...
Code CSS:<li> <label for="comments"> Comments: </label> <input id="comments" name="comments" class="text" type="text" /> </li>
Debbie





you can use something like
but are you sure you don't really want a <textarea>Code:<input type="text" style="height: 100px; width: 500px" name="txtInput" />
Code:<textarea name="txtArea" rows="20" cols="50"></textarea>


Why are you using an LI?
Also I am assuming you want an area for people to provide long reponses? The correct tag for this would be a <textarea></textarea>. Note that you have to close the tag!
you could then use this:
label {vertical-align:top}
textarea{ height:5em; width:25em}
(I am sizing the box in ems, but pixels and percentages are also ok}
Incidentally, a textarea can also be sized in the tag itself ... as a back up when CSS is off
For example:
<textarea id="comments" name="comments" COLS=40 ROWS=16> </textarea>
hope that helps.
==![]()
Brilliant ideas, elegant execution.
Graphic Design, Art Direction, Copywriting and Web Design.


You use a text area when you expect long , potentially multi-line input.
Brilliant ideas, elegant execution.
Graphic Design, Art Direction, Copywriting and Web Design.





Because that is what the SitePoint tutorial said to do...
Also I am assuming you want an area for people to provide long reponses? The correct tag for this would be a <textarea></textarea>. Note that you have to close the tag!
you could then use this:
label {vertical-align:top}
textarea{ height:5em; width:25em}
(I am sizing the box in ems, but pixels and percentages are also ok}
Incidentally, a textarea can also be sized in the tag itself ... as a back up when CSS is off
For example:
<textarea id="comments" name="comments" COLS=40 ROWS=16> </textarea>
hope that helps.
==![]()
Debbie





You would normally use <input> if you expect a single line text string from the user.
<textarea> is used when you want to give the user the option to enter a multi-line text string. For example, in a contact form you could use a <textarea> for the user to enter the message they want to send you in an email.





So does this syntax look okay?
Code HTML4Strict:<form action="submitted_form.php" method="post"> <fieldset> <legend>Post your Comments</legend> <ol> <li> <label for="name"> Name: </label> <input id="name" name="name" class="text" type="text" /> </li> <li> <label for="email"> Email: </label> <input id="email" name="email" class="text" type="text" /> </li> <li> <label for="comments"> Comments: </label> <textarea id="textarea" name="comments" class="text" rows="5" cols="50"></textarea> </li> <li> <input id="submit" class="submit" type="submit" value="Submit" /> </li> </ol> </fieldset> </form>
Code CSS:input.text, textarea{ background-color: #FFFFE0; }
Debbie





Okay, thanks for the help guys!!
Debbie
Bookmarks