Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text box and textarea content fonts

Status
Not open for further replies.

vinayak

Technical User
Sep 17, 2001
50
IN
Hi,
I have a text box and text area in web page, I'm not using any CSS for the controls. Problem is, text (font) displayed in both controls is not the same. Is there any way to bring consistancy among them?
 
Hi vinayak,

Yes you can !!!

In this example I assume that all the form-fields have font "arial" and only the text-area has an other font:

For IE you can add a style to the textarea:
<textarea style=&quot;font-family: arial&quot; ......

or put the style in a style-sheet:

.taStyle
{
font-family: arial;
}

<textarea class=&quot;taStyle&quot; ....

In NN4 (I can't test in NN6 here) this won't work but here you can add the same style to the <Form> tag to get it done. But this style in the <form> tag doesn't effect IE.

So if you add the style to both, you solved the problem:

<form style=&quot;font-family: arial&quot; ......
<textarea style=&quot;font-family: arial&quot; ......

or

<form class=&quot;taStyle&quot; ....
<textarea class=&quot;taStyle&quot; ....

Hope this helps,
Erik

<-- My sport: Boomerang throwing !!
!! Many Happy Returns !! -->
 
Hi,
I'm not using any font or CSS on any of my controls!!!!

In my Web page, text box conents and combo contents both have same font, however, only my textarea contents have a differnt font. I want to know why is my text area contents are different.
As I'm typing on my browser now, search text box at the top of the screen has arial font and this textarea has typewriter font!!!.

Thanks
 
Because it's default behaviour in (almost) all browsers. Textarea font has a &quot;typewriter&quot; style, called monospace font family. If you don't like it - override it with CSS.
 
Is it possible for user to change (typewriter) this font from within the browser to say like textarea font?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top