Jump to content
GranDad

textarea text size?

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

i reccommend the 2nd method shown above.Any changes you need to make you only have to make once, but can apply it to many tags.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

glad to see it worked out for ya.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...