GranDad Posted November 29, 2005 Share Posted November 29, 2005 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 More sharing options...
Skemcin Posted November 29, 2005 Share Posted November 29, 2005 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 More sharing options...
aspnetguy Posted November 29, 2005 Share Posted November 29, 2005 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. Link to comment Share on other sites More sharing options...
GranDad Posted November 29, 2005 Author Share Posted November 29, 2005 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. <{POST_SNAPBACK}> 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 More sharing options...
Skemcin Posted November 29, 2005 Share Posted November 29, 2005 glad to see it worked out for ya. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now