bulrush Posted August 4, 2010 Share Posted August 4, 2010 I have a form that uses some text boxes (type="text") and some <textarea> boxes. The font in the text boxes appear to be Ariel, but the font in the <textarea> are always some type of Courier. How do I get the fonts to be all the same in all my controls in the form? Here is some sample code I am using: $s='<tr><td>Product name: <td><input type="text" name="txtProdname" '. 'id="txtProdname" value="'.$row['prodname'].'" size="50" maxlength="50" /></tr>'; echo "$s\n"; $s='<tr valign="top"><td valign="top">Bullet: <td><textarea name="txtBullet[]" '. 'id="txtBullet[]" rows="2" '. 'cols="60" >'.$b.'</textarea> '; $s.='<input type="hidden" name="txtBullid[]" id="txtBullid[]" value="'.$bid.'" size="6" readonly />'; $s.='</tr>'; echo "$s\n"; Quote Link to comment https://forums.phpfreaks.com/topic/209799-fonts-different-between-text-box-and/ Share on other sites More sharing options...
lostprophetpunk Posted August 4, 2010 Share Posted August 4, 2010 You can give the textarea a class in css to be able to change the font and size to what your other text is. <textarea class="boxfix">...</textarea> Make sure to change the font size to match your other text. <style type="text/css"> boxfix { font-family: arial; font-size: 12pt; } </style> Quote Link to comment https://forums.phpfreaks.com/topic/209799-fonts-different-between-text-box-and/#findComment-1095155 Share on other sites More sharing options...
bulrush Posted August 4, 2010 Author Share Posted August 4, 2010 It's not working. I have a file style.css which contains, among other things, this: .inputfont { font-family: arial; font-size: 12pt; } I construct the <textarea> in my php file like this: while ($rowbull = mysqli_fetch_array($resbull)) { $b=trim($rowbull['bullettext']); $bid=$rowbull['bullid']; $s='<tr valign="top"><td valign="top">Bullet: <td><textarea name="txtBullet[]" '. 'id="txtBullet[]" rows="2" '. 'cols="60" class="inputfont" >'.$b.'</textarea> '; $s.='<input type="hidden" name="txtBullid[]" id="txtBullid[]" value="'.$bid.'" size="6" readonly />'; $s.='</tr>'; echo "$s\n"; $oldbullarr[]=$b; $oldbidarr[]=$bid; $cnt++; } //while ($rowbull... I tried spelling the font "Ariel" and "Arial". The font in the <textarea> didn't change. Does capitalization matter? How can I find out the correct spellings (and capitalizations) of the fonts my browser (Firefox 3.6 on WinXP) uses? Quote Link to comment https://forums.phpfreaks.com/topic/209799-fonts-different-between-text-box-and/#findComment-1095168 Share on other sites More sharing options...
RZPB Posted September 15, 2011 Share Posted September 15, 2011 Bulrush, This is a v late reply and I suspect you will have resolved your <textarea> font issues however I read your post and the simple answer to fix this is below. Hope this helps you and anyone else who sees this post. http://jsfiddle.net/audetwebdesign/gakfk/ Quote Link to comment https://forums.phpfreaks.com/topic/209799-fonts-different-between-text-box-and/#findComment-1269596 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.