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!

Font face in a form

Status
Not open for further replies.

Huitzilopochtli

Programmer
Feb 18, 2002
81
DE
Hello

I have a form and I know how to use the font attribute so that the user types in verdana, Times, etc, as in:

<form method=&quot;post&quot; action=&quot;submit.asp&quot;>

<p><font face=&quot;verdana&quot; color=&quot;white&quot; size=&quot;1&quot;><b>Topic: </b></font>&nbsp;&nbsp;&nbsp;<input type=&quot;text&quot; name=&quot;topic&quot; size=&quot;20&quot;></p>

but how do I control the font in the textarea? What I have is the following, but it ignores 'font' and writes in Times. I would like it to be consistent with the other fields I have (that is, verdana)?

<font face=&quot;verdana&quot; color=&quot;white&quot; size=&quot;1&quot;><b>Message: </b></font><br>
<textarea name=&quot;body&quot; rows=&quot;9&quot; cols=&quot;40&quot;></textarea><br>
<p align=center><input type=&quot;submit&quot; value=&quot;Submit&quot;>
<input type=&quot;reset&quot; value=&quot;Reset&quot;></p>
</form>

Many thanks for any suggestions

Huitzilopochtli

 
<font face=&quot;verdana&quot; color=&quot;white&quot; size=&quot;1&quot;><b>Message: </b></font><br>
<textarea style=&quot;font-family:veranda;&quot; name=&quot;body&quot; rows=&quot;9&quot; cols=&quot;40&quot;></textarea><br>
<p align=center><input type=&quot;submit&quot; value=&quot;Submit&quot;>
<input type=&quot;reset&quot; value=&quot;Reset&quot;></p>
</form>

Rick if(($question==&quot;has been bugging me&quot;
AND $answer==&quot;fixed the problem&quot;) OR $answer==&quot;really good post&quot;){
print(&quot;Star&quot;);
}else{
print(&quot;Thanks.&quot;);
}
 
Define a CSS style with font settings:
<style>
.one { font: 8pt verdana,arial,sans-serif }
</style>

and apply it to all form elements that you like:

<textarea class=one>

This method is very flexible so you can modify all fields at once. If you apply the style to all input fields it will make all of them look the same. You can also add other properties like &quot;width: 120px&quot; to that style so you'll control the width of the form elements.

 
Or you could just do this and change all the textareas:
<style>
textarea {font-family: verdana}
</style>

Rick if(($question==&quot;has been bugging me&quot;
AND $answer==&quot;fixed the problem&quot;) OR $answer==&quot;really good post&quot;){
print(&quot;Star&quot;);
}else{
print(&quot;Thanks.&quot;);
}
 
Hello

Very many thanks to both of you. Sorted it out!

Best wishes

Huitzilopochtli
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top