Page 1 of 1

Html form

Posted: Tue Feb 17, 2004 4:08 pm
by pinehead18
Is it possible to tell an input style how long to be? <input type=text name=test width=width?

I can't seem to get it to work any ideas/

Thanks
ANthony

Posted: Tue Feb 17, 2004 4:33 pm
by uberpolak

Code: Select all

<input type="text" size="30" />

Posted: Tue Feb 17, 2004 9:23 pm
by no_memories
CSS can do alot for forms.

Style -->

#field1 {
color: #000;
background: #ccc;
border: 1px solid #f00;
height: 25px;
width: 150px;
}

XHTML -->

<input type="text" id="field1" title="Opinion Text Field" />

One thing to note about this method, it's advisable to put a generic size="25" for old browsers (CSS will over ride the size attribute). If you are using the @import rule in CSS 2, it hides all CSS for browsers like NS 4, leaving only text flow and (usually) a generic table layout; unless you are now coding without tables.