SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Isn't box model all wrong?

    Shouldn't box model work like it works in IE?

    If you set:
    width: 100px;
    border-width: 10px;
    margin: 10px;

    I think, this should produce a box that is 100px wide not 140px wide. So it should have the content area only 60 px wide!

    Why you ask? Well:
    1. We explicitly declared the width! If I declared it, I want it to be as wide as I declared it!

    2. When parsing code, browsers always consider the whole box, not just the content area. If they did and you would set top: 0px and border-width-top: 10px then no border would actually show on the screen cause the browser would align content area (and not the border) with the top of the document. Border would so be off the document (on top of it).

  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2001
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah, that's what i thought at first. IE's interpretation of the box model made sense... while W3C's specifications were a bit bizzare.

    it jsut takes time getting used to. dealing with tables just made us think that way :Þ.


    border shouldn't get cut off...
    signature

  3. #3
    SitePoint Member
    Join Date
    Apr 2001
    Location
    glasgow
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.tantek.com/CSS/Examples/boxmodelhack.html

    tantek celik explains this much better than i ever could.


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
  •