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 3 of 3
  1. #1
    New Coder
    Join Date
    May 2008
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Trying to Get Inputs to Have Consistent Width

    Hi everyone,

    I have a little issue that's really buggin me. I just finished validating my home page (www.infiniteguitar.com) with the following doctype:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


    The rest of the site's pages however have this incomplete doctype:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


    I noticed though that the difference in doctype affects the size of form inputs. If you look at the top right, you'll see the login area. When going from the home page to any other page, the inputs shrink in size by a few pixels. Very annoying. Is there a way I can make it to where they don't change in size even though different doctypes are being used?

    Here's the current css that I'm using for the inputs:

    .loginbox {

    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    color: #000000;
    background: #FFFFFF;
    border-top: 1px solid #777777;
    border-right: 1px solid #777777;
    border-bottom: 1px solid #777777;
    border-left: 1px solid #777777;
    width:70px
    }

    Is there a different way I can define the width of the inputs where they are consistent regardless of doctype? Any help would be much appreciated. Thank you!!

  • #2
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    Try this at the start of your css. It resets browsers to zero at the start. It is easy to implement and sometimes works wonders.

    Code:
    * {
    margin: 0;
    padding: 0;
    }
    html, body {
    height:100&#37;;
    width:100%;
    }
    Frank
    * Sources (updated: 21.11.2012.
    Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.

  • #3
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    Could you also share to us the reason behind using incomplete doctypes
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph


  •  

    Posting Permissions

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