...

View Full Version : Changing the font within forms



kjc
10-23-2002, 04:40 PM
Does anyone know how it is possible to change the default font that is used when someone enters data in a form.

At the moment all my forms use the horrible courier font.

eak
10-23-2002, 04:46 PM
that is easy. you have to use css.
try something like this for ie and moz/ns6+

input{
font-family:verdana,arial,sans-serif;
font-size:12px;
color:#000000;

... any other css declarations you want for an input
}

or this for more exact styles... moz/ns6+ not ie... yet

input[type=text]{
styles for inputs of type=text
}
input[type=submit]{
styles for inputs of type=submit
}
input[type=reset]{
styles for inputs of type=reset
}

beetle
10-23-2002, 06:07 PM
Note: by default most TEXTAREA objects use courier...make sure to set style rules for them too

textarea {
font-family:verdana,arial,sans-serif;
font-size:12px;
color:#000000;
}

or

input, textarea {
font-family:verdana,arial,sans-serif;
font-size:12px;
color:#000000;
}

vkidv
10-23-2002, 06:47 PM
use it actually in the form element in the HTML.......its a bit more typing...but it can be helpfull.......well sort of


<input type="text" value="hello" style="font-family:Verdana; color:red; background-color:black;">


this box will have a black background and a red color and the font verdana..



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum