#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Location
    atlanta,ga
    Posts
    255
    Rep Power
    24

    Netscape css and padding


    When I use padding in a box it increases the width of the box by the amount of the padding when viewed in NS. IE won't.
    Anybody know of a good solution to this problem?
    Code:
    <html>
    <head>
    
    <style type="text/css">
    .box1{
    position: absolute;
    top: 20px;
    left: 40px;
    width: 50px;
    height: 30px;
    border-width: 1px;
    border-style: solid;
    }
    
    .box2{
    position: absolute;
    top: 55px;
    left: 40px;
    width: 50px;
    height:30px;
    border-width: 1px;
    border-style: solid;
    padding-left: 10px;
    }
    </style>
    
    </head>
    
    <body>
    <div class = 'box1'>
    box 1
    </div>
    <div class = 'box2'>
    box 2
    </div>
    </body>
    </html>
    Thanks
  2. #2
  3. |<.+#f@#+.&.|
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2002
    Location
    norway
    Posts
    3,009
    Rep Power
    1224
    if yoy read about w3c's box model http://www.w3.org/TR/CSS2/box.html
    you'll see that NS's behaviour is correct.
    to make msie follow the same rule, make sure you use a doctype that triggers the standard compliance mode.
    http://www.hut.fi/u/hsivonen/doctype.html
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Location
    atlanta,ga
    Posts
    255
    Rep Power
    24
    Thank you

IMN logo majestic logo threadwatch logo seochat tools logo