textarea - font smaller?

liunx

Guest
I've got this textarea that I apply the following style to:

.formFields{font-size: 75%; background: #f0f0f0; margin: 2px 5px 2px 0;}

Here is the actual text area:
<textarea class="formFields" name="" id="" cols="30" rows="5"></textarea>

This is coded XHTML 1.0 transitional

The problem is that the font is smaller than the other textboxes where I apply the same class. IE its fine, but its smaller in FF... which baffles me (at worst, it should be the other way around :D)It's probably because of the monospaced font. In FF, when I use a monospace font, it comes out smaller than when I'm using this font (Arial).

[J]onaForgot to mention... here the style for the body:

body{margin: 0px 0px 0px 0px; padding: 0px; font-family: Arial, Helvetica, sans-serif;}

So, I'm using Arial as well...I don't think the body font style is inherited by the textarea, does it? Do you have this online?

[J]onaUnfortunately, no. It's an intranet site at work... everything else is working fine, but this little quirk.I just tested it, and changing the font-family of the body does not affect the textarea. Use style="font-size:75%; font-family: arial, sans-serif;" on the textarea, and see what you get.

[J]onaCool! It works now.

It works in IE as well... Thanks!Actually... it seems that the size doesn't match. Does the textarea take a certain percentage somewhere else? I put 75% and it seems bigger than the rest. @ 70% it seems smaller. Both in IE and FF.Try 72.5%. :D

Add font-family: Arial, Helvetica, sans-serif to the .formFields class. That should fix it.

[J]onaI created a separate class that overrides (font size, family and background color) the textarea and removed the reference to the formFields class.

I could just put 75.5% on the textarea style instead I suppose.Originally posted by DanDigiMan
I created a separate class that overrides (font size, family and background color) the textarea and removed the reference to the formFields class.

I could just put 75.5% on the textarea style instead I suppose.

So my suggestion only worked for me? I put it at 72.5% font-size for the textarea, and font-family to arial for all form fields and it looked fine to me.

[J]onaSeems to only work for IE on my end...

Code:

#InputForm textArea{font-size: 72.5%; font-family: Arial, Helvetica, sans-serif; background: #f0f0f0;}

<textarea name="a" id="a" cols="30" rows="5">abc</textarea>
 
Back
Top