;

PDA

Click to See Complete Forum and Search --> : Forms in firefox?


tidenburg
11-22-2006, 02:09 PM
Is there any way to resize forms in firefox using css, it doesnt seem to work for me.

JPnyc
11-22-2006, 02:29 PM
You can control size using css. Can you show us what you're using?

catbert303
11-23-2006, 07:51 AM
Sure, you could set the dimensions of all your input fields using,

input {
width: 200px; height: 25px;
}

however this would set the dimensions of all input fields, text, password, checkboxes etc... which isn't ideal. if you don't care about IE 6 and older you can use attribute selectors to specify different types of input fields,

input[type="text"] {
width: 200px; height: 25px;
}
input[type="checkbox"] {
width: 15px; height: 15px;
}

This should be supported in IE 7, Opera, Mozilla, Safari etc...

On the other hand (and most likely) if you do need to cater for IE 6 and older, you can add a class attribute to your input fields and then use the class selector in your CSS to control which styles are applied to which input fields,

input.txt {
width: 200px; height: 25px;
}
input.cb {
width: 15px; height: 15px;
}

where cb is a class for all the fields you want to make 15px by 15px and txt is a class on the fields you want to make 200px by 25px

<input type="text" class="txt" value="Hello">

<input type="checkbox" class="cb" value="1">

textareas are treated separately to the other input fields, they just need something like,

textarea {
width: 400px; height: 300px;
}