...

View Full Version : text and textarea width vary between different browsers



camaross
04-24-2011, 04:06 PM
I am using both text and textarea in my forms. My goal is to make their width the same.

Currently, I am using these


<input type="text" name=xx size="100"/>

<textarea name=yy cols="75" rows="10">$Eabstract$</textarea>

The problem is that the width of the text box and textarea will show up differently in different browsers. For example, the current setting works great in Firefox. But the textarea will appear narrower in the IE. If I increase the cols of the textarea, it will appear wider than the text in the Firefox.

What should I do?

Is there a way I can set their width as pixels instead?

oesxyl
04-24-2011, 04:48 PM
I am using both text and textarea in my forms. My goal is to make their width the same.

Currently, I am using these


<input type="text" name=xx size="100"/>

<textarea name=yy cols="75" rows="10">$Eabstract$</textarea>

The problem is that the width of the text box and textarea will show up differently in different browsers. For example, the current setting works great in Firefox. But the textarea will appear narrower in the IE. If I increase the cols of the textarea, it will appear wider than the text in the Firefox.

What should I do?

Is there a way I can set their width as pixels instead?
in a css file try:


textarea, input { width: 400px; }

or


textarea[name='yy'] { width: 400px; }
input[name='xx'] { width: 400px; }


since markup is invalid is possible to not work as you expect.

best regards

abduraooft
04-24-2011, 04:49 PM
Is there a way I can set their width as pixels instead?

<input type="text" name="xx" class="text"/>

input.text{
width:100px;
} and similarly for textarea.

camaross
04-25-2011, 04:47 AM
Thank you very much, guys.

johnktaylor
04-25-2011, 08:59 AM
try the following code:

<input type="text" name="xx" style="width:100px;" />

<textarea name="yy" style="width:100px;">$Eabstract$</textarea>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum