Jump to content

textarea text size?


GranDad

Recommended Posts

I am new to PHP and CSS. :) How can I set the default text font and size for html body and for textarea? I am using PHP5, HTML4 and CSS.I can control text-size in <input type="text with style but it does not affect textarea's or drop-down option's or multiple select lists.I am working on a user data input web page with option choices and textareas for free hand text.I discovered from this formum how to control the text fonts for submit buttons, so I know how to do that.

Link to comment
Share on other sites

Welcome to the forum, glad you found us.The "style" attribute should work in any of the <form> tags.

<!-- inline --><form action="##" method="get"><input type="text" name="field01" style="font-family:MS Trebuchet, Tahoma; font-size:10px;" value="[text here]"><textarea name="field02" rows="5" cols="25" style="font-family:MS Trebuchet, Tahoma; font-size:10px;">[text here]</textarea></form>

or

<!-- on page --><style type="text/css" media="all">body, input, textarea {font-family:MS Trebuchet, Tahoma;font-size:10px;}</style><form action="##" method="get"><input type="text" name="field01" value="[text here]"><textarea name="field02" rows="5" cols="25">[text here]</textarea></form>

Let me now if this doesn't work.

Link to comment
Share on other sites

Welcome to the forum, glad you found us.The "style" attribute should work in any of the <form> tags.
<!-- inline --><form action="##" method="get"><input type="text" name="field01" style="font-family:MS Trebuchet, Tahoma; font-size:10px;" value="[text here]"><textarea name="field02" rows="5" cols="25" style="font-family:MS Trebuchet, Tahoma; font-size:10px;">[text here]</textarea></form>

or

<!-- on page --><style type="text/css" media="all">body, input, textarea {font-family:MS Trebuchet, Tahoma;font-size:10px;}</style><form action="##" method="get"><input type="text" name="field01" value="[text here]"><textarea name="field02" rows="5" cols="25">[text here]</textarea></form>

Let me now if this doesn't work.

Thanks a lot for your help Skemcin. This code works so now I will work it into my project.GranDad
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...