SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist IJoeR's Avatar
    Join Date
    Feb 2003
    Location
    Somewhere in, MD
    Posts
    400
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Strange CSS Width problem

    I've set a class to a formfield. I have other formfields in my form and i'm making the right edge line up with each other. The fields are stacked vertically.

    So, one set of fields is actually 3 fields on 1 line. The very last form field is having a strange width problem when i view it in different browsers.

    So if i set it for 92px and then look at in IE55, IE6, IE7, Firefox and Safari and Firefox on MAC I get varying widths.

    With those browsers in mind is there a simple way to write the width so only those browsers see a certain width amount?

    I've seen some hacks, but I've never seen this problem before on a form text field.

  2. #2
    SitePoint Wizard bronze trophy DaveWoods's Avatar
    Join Date
    Dec 2004
    Location
    Derbyshire - UK
    Posts
    2,651
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    They should all see the same width. If you've got a valid doctype then IE6, IE7, Firefox and Safari will all render the box model correctly in that margin, padding and border will be added to the width.

    Without a valid doctype, IE6 and IE7 will go into quirks mode which renders them inside the box and will therefore appear smaller.

    So obviously, it's beneficial to use a doctype for consistency in these browsers.

    However, IE5.5 and earlier will render the broken box model even if you include this doctype so you'll need to use either a hack or conditional comments to serve a separate stylesheet with the correct width's taking into account the margin, padding and borders.

    Hope this sounds like the problems you're having?

    Also make sure you specify font's and sizes on form fields either by explicitly telling them to inherit or by specifying a font. This can also cause the problems you're describing.

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,546
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    What Dave said above plus also make sure that what you have inside the form field actually fits or IE6 and under will stretch the width to accommodate.


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
  •