Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    kjc
    kjc is offline
    New Coder
    Join Date
    Jun 2002
    Location
    England
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Changing the font within forms

    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.
    Eternity

  • #2
    eak
    eak is offline
    Regular Coder eak's Avatar
    Join Date
    Jun 2002
    Location
    Nashville, TN
    Posts
    354
    Thanks
    0
    Thanked 26 Times in 26 Posts
    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
    }
    eak | "Doing a good deed is like wetting your pants; every one can see the results, but only you can feel the warmth."

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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;
    }
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #4
    Regular Coder
    Join Date
    Sep 2002
    Posts
    157
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ...good way if you only have 1-2 boxes..

    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..
    Regards
    VKiDV


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •