Click to See Complete Forum and Search --> : Form widths with CSS


derekjackson
03-12-2006, 11:16 AM
Hi,
I'm using forms for the first time and having fun defining the text box widths. It seems the only way I can define a width is using the 'size' attribute in the 'input' tag, but this is defined in characters, so varies between browsers.

Is there any way to use CSS to specify a width, in pixels? I've tried a standard 'width' definition in the element's definition, but it doesn't seem to have any effect.

The HTML:
<div id="formq1"><input type="text" name="quantity1" /></div>

The CSS:
#formq1 { top: 50px; left: 0px; position: absolute; width: 20px; }

Any ideas why it only responds to a 'size' attribute? I'm sure it's something really simple but I can't see it...

BonRouge
03-12-2006, 12:19 PM
#formq1 input {
width:20px;
}

derekjackson
03-12-2006, 01:49 PM
And that's all it was?! :) Cheers!