SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist mumford1's Avatar
    Join Date
    Sep 2002
    Location
    UK
    Posts
    573
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Input Boxes.... Longer in Netscape

    Hi

    How do you get input boxes the same size in Netscape as you do in Explorer.

    They seem to be alot longer in Netscape.

    Thanks for any help!

  2. #2
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Due to browser and platform inconsistencies in the way they render monospaced fonts, it is nigh on impossible to get text input fields and textareas to be the same width in MSIE and NN trough the use of x/html alone.

    However, you can regain some control over the display of your form elements through the use of some basic css.

    One reliable method (amongst several) is to create a class that can be applied to text fields and textareas.

    Code:
    css:
    
    .textinput {
    width: 200px; /* values can be in % or any other valid unit */
    font: 11pt Georgia, serif; /* font and size chosen as example only */
    }
    
    
    x/html:
    
    <input type="text" value="initial" class="textinput" /><br />
    <textarea class="textinput" >initial</textarea>
    This will set the width, font-family and font-size to be used in any css1 compliant browser (which is pretty much anything built within the past four years.)
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  3. #3
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, different versions of netscape are different - Netscape 7 (and maybe N6) draw inputs a lot closer to IE's size than NN4.x


Bookmarks

Posting Permissions

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