Html form

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

Html form

Post 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
User avatar
uberpolak
Forum Contributor
Posts: 261
Joined: Thu Jan 02, 2003 10:37 am
Location: Next to the bar

Post by uberpolak »

Code: Select all

<input type="text" size="30" />
User avatar
no_memories
Forum Contributor
Posts: 145
Joined: Sun Feb 01, 2004 7:12 pm
Location: New York City

Post 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.
Post Reply