Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Width:100%, 100% of what?

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #34301
    pbrecursion
    Member

    Can someone clarify this for me?
    If this is the case:


    div#page { width:960px; }
    div#box1 {
    padding:10px;
    width:100%;
    }
    div#box2 {
    padding:10px;
    width:100%;
    }
    p {
    padding:0 10px;
    width:100%;
    }




    Paragraph






    Are the widths of the elements as follows?
    #page: 960px
    #box1: 960px
    #box2: 940px
    p: 920px

    #86928

    Keep in mind that you could use box-sizing: border-box; (with browser prefixes) to get the sizing you first thought in all browsers except for IE 7 and below.

    See here for more info: http://joshuanhibbert.com/weblog/2011/08/dealing-with-a-broken-box-model-by-using-box-sizing/

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.