validate HTML

Discussion in 'HTML' started by shank, Sep 23, 2003.

  1. shank

    shank Guest

    I'm on the W3 website and trying to validate my page. A BUNCH of problems
    showed up. I'm using Dreamweaver MX and use it to create the code. This
    should be a no brainer, but checking it for 4.01 transitional is dismal.

    <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0"
    marginheight="0">

    One of the red flags is that the above margins are invalid attributes of the
    <body> tag.
    OK... How do I set my page to have "0" margins?
    And why would Dreamweaver stick them in there?

    Can someone give me a clue to conforming to the validation process?
    I'm using vbScript and ASP and I'm not sure I will ever be able to comply
    100%.
    Has anyone else run into this?

    thanks!
    shank, Sep 23, 2003
    #1
    1. Advertising

  2. shank

    brucie Guest

    In post <jJ2cb.7156$>
    shank said...

    > I'm on the W3 website and trying to validate my page. A BUNCH of problems
    > showed up. I'm using Dreamweaver MX and use it to create the code. This
    > should be a no brainer, but checking it for 4.01 transitional is dismal.


    new documents should use the strict DTD

    > <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0"
    > marginheight="0">
    >
    > One of the red flags is that the above margins are invalid attributes of the
    > <body> tag.
    > OK... How do I set my page to have "0" margins?


    body{margin:0;padding:0;}

    > And why would Dreamweaver stick them in there?


    its a poor quality editor. just because "everybody" uses it doesn't
    necessarily mean its good. look at IE.

    > Can someone give me a clue to conforming to the validation process?


    hand code. you'll know what every line does and why its there.

    > I'm using vbScript and ASP and I'm not sure I will ever be able to comply
    > 100%.


    any page can validate 100%



    --
    24/September/2003 07:22:20 am
    brucie, Sep 23, 2003
    #2
    1. Advertising

  3. shank

    Adrienne Guest

    Gazing into my crystal ball I observed "shank" <>
    writing in news:jJ2cb.7156$:

    > I'm on the W3 website and trying to validate my page. A BUNCH of
    > problems showed up. I'm using Dreamweaver MX and use it to create the
    > code. This should be a no brainer, but checking it for 4.01
    > transitional is dismal.
    >
    ><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0"
    > marginheight="0">
    >
    > One of the red flags is that the above margins are invalid attributes
    > of the
    ><body> tag.
    > OK... How do I set my page to have "0" margins?
    > And why would Dreamweaver stick them in there?
    >
    > Can someone give me a clue to conforming to the validation process?
    > I'm using vbScript and ASP and I'm not sure I will ever be able to
    > comply 100%.
    > Has anyone else run into this?
    >
    > thanks!
    >
    >
    >


    You're familiar with includes, so start including a style sheet definition
    for your pages.

    <link rel="stylesheet" href="style.css" type="text/css">

    *** style.css ***
    body {margin:0}

    You might want to think about using another editor. I think you would be
    happy with http:///www.html-kit.com , has syntax coloring, plugins (spell
    check, Thesaurus, ASP specific tools), scripting to define frequently used
    code (like sql select statements), HTML-Tidy, integrates with TopStyle for
    stylesheets. Best of all, it's free.

    Trust me, even though you're writing ASP, you'll be able to validate if you
    stick to keeping HTML for the markup, CSS for presentation, and ASP/SQL for
    serverside.

    One more little hint: escape &'s as &amp;

    CSS Tutorial: http://www.w3schools.com/css/default.asp
    --
    Adrienne Boswell
    Please respond to the group so others can share
    http://www.arbpen.com
    Adrienne, Sep 23, 2003
    #3
  4. shank

    brucie Guest

    In post <Xns93FF93A05652arbpenyahoocom@207.115.63.158>
    Adrienne said...

    > body {margin:0}


    margin on the <body> is actually incorrect. you cant have a margin
    outside of the available canvas area. operas use of padding on the
    <body> is correct.



    --
    24/September/2003 07:40:02 am
    brucie, Sep 23, 2003
    #4
  5. shank

    Adrienne Guest

    Gazing into my crystal ball I observed brucie <-
    html.org> writing in news:l7e41slvpcby$:

    > In post <Xns93FF93A05652arbpenyahoocom@207.115.63.158>
    > Adrienne said...
    >
    >> body {margin:0}

    >
    > margin on the <body> is actually incorrect. you cant have a margin
    > outside of the available canvas area. operas use of padding on the
    ><body> is correct.
    >
    >
    >


    Thanks, brucie. Another mystery of life solved.

    --
    Adrienne Boswell
    Please respond to the group so others can share
    http://www.arbpen.com
    Adrienne, Sep 23, 2003
    #5
  6. shank

    DU Guest

    shank wrote:

    > I'm on the W3 website and trying to validate my page. A BUNCH of problems
    > showed up. I'm using Dreamweaver MX and use it to create the code. This
    > should be a no brainer, but checking it for 4.01 transitional is dismal.


    At this point, you should use a strict DTD and validate your document.

    >
    > <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0"
    > marginheight="0">
    >
    > One of the red flags is that the above margins are invalid attributes of the
    > <body> tag.
    > OK... How do I set my page to have "0" margins?
    > And why would Dreamweaver stick them in there?
    >
    > Can someone give me a clue to conforming to the validation process?
    > I'm using vbScript and ASP and I'm not sure I will ever be able to comply
    > 100%.
    > Has anyone else run into this?
    >
    > thanks!
    >
    >


    It's not recommendable to remove all padding and margin on the element
    (body) rendering your content. Every known documents appearing on every
    possible media use some kind of padding or margins. I personally use
    this for all my pages.

    <style type="text/css">
    body {margin:16px; padding:0px; color:black; background-color:white;}
    </style>

    Browsers all have default margin (or padding like Opera 7) values for
    the body element.

    DU
    --
    Javascript and Browser bugs:
    http://www10.brinkster.com/doctorunclear/
    - Resources, help and tips for Netscape 7.x users and Composer
    - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
    http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
    DU, Sep 23, 2003
    #6
  7. shank

    DU Guest

    brucie wrote:

    > In post <Xns93FF93A05652arbpenyahoocom@207.115.63.158>
    > Adrienne said...
    >
    >
    >>body {margin:0}

    >
    >
    > margin on the <body> is actually incorrect. you cant have a margin
    > outside of the available canvas area.


    What are you saying exactly? Margin on the body element is rendered in
    all W3C CSS1 compliant browsers. I don't understand why you said what
    you said.

    DU
    --
    Javascript and Browser bugs:
    http://www10.brinkster.com/doctorunclear/
    - Resources, help and tips for Netscape 7.x users and Composer
    - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
    http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
    DU, Sep 23, 2003
    #7
  8. shank

    Whitecrest Guest

    In article <>, -html.org
    says...
    > > And why would Dreamweaver stick them in there?

    > its a poor quality editor. just because "everybody" uses it doesn't
    > necessarily mean its good. look at IE.


    Well personal opinion....

    > > Can someone give me a clue to conforming to the validation process?

    > hand code. you'll know what every line does and why its there.


    You do not need to hand code every line to know what it does.

    > > I'm using vbScript and ASP and I'm not sure I will ever be able to comply
    > > 100%.

    > any page can validate 100%


    I will agree there. But validating the code does not mean that the page
    looks good. You can have a mighty shitty looking validated page.

    --
    Whitecrest Entertainment
    www.whitecrestent.com
    Whitecrest, Sep 23, 2003
    #8
  9. shank

    brucie Guest

    In post <bkqfp9$qsb$>
    DU said...

    >> margin on the <body> is actually incorrect. you cant have a margin
    >> outside of the available canvas area.


    > What are you saying exactly? Margin on the body element is rendered in
    > all W3C CSS1 compliant browsers. I don't understand why you said what
    > you said.


    if you consider the <body> element to be the available canvas area and
    not the <html> element then padding is the space between the <body>
    element and its content. that makes sense. i don't think anyone would
    disagree with that.

    <html>
    <head>
    </head>
    <body>
    <padding>
    content of site
    <padding>
    </body>
    </html>

    if you consider <html> to be the available canvas area then margin is
    the space between the <html> element and the <body> and <head>
    element.

    <html>
    <margin>
    <head>
    </head>
    <body>
    content of site
    </body>
    <margin>
    </html>


    that just doesn't look right. its more logical to use padding on the
    <body> element and the suggested CSS2 style sheet has padding 8px, no
    margin.

    --
    24/September/2003 09:15:44 am
    brucie, Sep 24, 2003
    #9
  10. shank

    DU Guest

    brucie wrote:
    > In post <bkqfp9$qsb$>
    > DU said...
    >
    >
    >>>margin on the <body> is actually incorrect. you cant have a margin
    >>>outside of the available canvas area.

    >
    >
    >
    >>What are you saying exactly? Margin on the body element is rendered in
    >>all W3C CSS1 compliant browsers. I don't understand why you said what
    >>you said.

    >
    >
    > if you consider the <body> element to be the available canvas area and
    > not the <html> element then padding is the space between the <body>
    > element and its content. that makes sense. i don't think anyone would
    > disagree with that.


    Are you saying that borders and padding on the root element (html)
    should not be rendered? Are you saying that margins on the body element
    shouldn't be rendered? Are you saying that the body element can not
    render margins? Are you saying that the body element does not comply
    with CSS1 box model?

    >
    > <html>
    > <head>
    > </head>
    > <body>
    > <padding>
    > content of site


    What if the author inserts here:
    <p style="position:absolute; top:-300px; left:-200px;">Filling here</p>

    > <padding>
    > </body>
    > </html>
    >
    > if you consider <html> to be the available canvas area then margin is
    > the space between the <html> element and the <body> and <head>
    > element.
    >


    Is that so? margin on the body element should only be rendered if the
    head has the rule {display:block}?

    > <html>
    > <margin>
    > <head>
    > </head>
    > <body>
    > content of site
    > </body>
    > <margin>
    > </html>
    >


    Regardless of the way you define what is the available canvas area, I
    still don't see why margins on the body element should not (or can not
    or are preferable not to) be used in a style sheet in any/all conditions.

    >
    > that just doesn't look right. its more logical to use padding on the
    > <body> element and the suggested CSS2 style sheet has padding 8px, no
    > margin.
    >


    Margins are part of the CSS1 box model. Regardless of how you define the
    available canvas area and why you need to define it, I don't see why
    body {padding:<value>} is any better or superior to body
    {margin:<value>}. IMO, these properties can both be used for the body
    element and both should be rendered if used. FWIW, CSS2.1 uses margins
    on the body element, not padding.

    http://www.w3.org/TR/CSS21/sample.html

    DU
    --
    Javascript and Browser bugs:
    http://www10.brinkster.com/doctorunclear/
    - Resources, help and tips for Netscape 7.x users and Composer
    - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
    http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
    DU, Sep 24, 2003
    #10
  11. shank

    brucie Guest

    In post <>
    Whitecrest said...

    >>> And why would Dreamweaver stick them in there?


    >> its a poor quality editor. just because "everybody" uses it doesn't
    >> necessarily mean its good. look at IE.


    > Well personal opinion....


    not really. if you purchase a program you want it to do what its
    designed to do and do it properly. if you purchase a media player you
    want it to be able to play media and do it properly. if you purchase a
    graphics editor you want it to be able to edit graphics and do it
    properly. why would or should a html editor be any different?

    if browsers didn't have error correction there would be very few html
    editors on the market or they would do what they were designed to do
    properly.

    DW/FP/etc etc users really need to ask themselves why they paid so
    much for a program that doesn't do what it was designed to do properly
    and for some reason think that its acceptable that it doesn't.

    would anyone think it acceptable if their graphics editor didn't edit
    graphics properly? media player not play media properly? i think not.
    why then is it acceptable for a html editor?


    --
    24/September/2003 10:55:47 am
    brucie, Sep 24, 2003
    #11
  12. shank

    DU Guest

    brucie wrote:

    > In post <>
    > Whitecrest said...
    >
    >
    >>>>And why would Dreamweaver stick them in there?

    >
    >
    >>>its a poor quality editor. just because "everybody" uses it doesn't
    >>>necessarily mean its good. look at IE.

    >
    >
    >
    >>Well personal opinion....

    >
    >
    > not really. if you purchase a program you want it to do what its
    > designed to do and do it properly. if you purchase a media player you
    > want it to be able to play media and do it properly. if you purchase a
    > graphics editor you want it to be able to edit graphics and do it
    > properly. why would or should a html editor be any different?
    >
    > if browsers didn't have error correction there would be very few html
    > editors on the market or they would do what they were designed to do
    > properly.
    >
    > DW/FP/etc etc users really need to ask themselves why they paid so
    > much for a program that doesn't do what it was designed to do properly
    > and for some reason think that its acceptable that it doesn't.
    >
    > would anyone think it acceptable if their graphics editor didn't edit
    > graphics properly? media player not play media properly? i think not.
    > why then is it acceptable for a html editor?
    >
    >


    I agree entirely 100% with you on this. I agree that this Dream Weaver
    MX html editor tool can be, should be, ought to be improved furthermore.
    But I can't resist the temptation to say that some people obviously
    think that Dream Weaver MX is good enough:

    "The following authoring tools adhere to the W3 standards. (...)
    Macromediaâ„¢ Dreamweaverâ„¢ MX"
    http://devedge.netscape.com/toolbox/tools/2003/authoring/

    "Macromedia Dreamweaver MX
    W3C valid XHTML? Yes"
    http://www.backupbrain.com/2002_11_17_archive.html#a003122

    DU
    --
    Javascript and Browser bugs:
    http://www10.brinkster.com/doctorunclear/
    - Resources, help and tips for Netscape 7.x users and Composer
    - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
    http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
    DU, Sep 24, 2003
    #12
  13. shank

    brucie Guest

    In post <bkqq2t$smh$>
    DU said...

    >> if you consider the <body> element to be the available canvas area and
    >> not the <html> element then padding is the space between the <body>
    >> element and its content. that makes sense. i don't think anyone would
    >> disagree with that.


    > Are you saying that borders and padding on the root element (html)
    > should not be rendered?


    if you consider the <html> element the available canvas area and stick
    a margin or border on it then where is the margin or border supposed
    to go? the margin and border would be outside the available canvas
    area.

    <html> element as the available canvas area:

    +<html>---available canvas area +---+
    margin - border | padding <body></body> padding | border - margin
    +----------------------------</html>+

    <body> element as the available canvas area

    +<body>---available canvas area +---+
    margin - border | padding <site content> padding | border - margin
    +----------------------------</body>+

    some problem in each case. the border and margins are outside the
    available canvas area.

    > Are you saying that margins on the body element
    > shouldn't be rendered?


    it all comes down to what is the available canvas area of the browser.
    is it the <html> element or the <body> element?

    its logical to consider the <body> element the available canvas area,
    not the <html> element. the <body> is the documents content, the bit
    thats displayed in the available canvas area. applying a margin or
    border would place the margin or border outside the available canvas
    area.

    > Are you saying that the body element can not
    > render margins?


    i'm saying that the <body> element is the available canvas area of the
    browser, not the <html> element. applying a margin or border on the
    <body> element would place them outside the available canvas area.

    > Regardless of the way you define what is the available canvas area,


    what the available canvas area is is the point of it all. it is either
    the <html> element or the <body> element.

    if the available canvas area is the <html> element margins and borders
    should not apply but can be applied to the <body> element.

    if the available canvas area is the <body> element then margins and
    borders should not apply.

    you cant place margins and borders outside the available canvas area.


    --
    24/September/2003 11:11:34 am
    brucie, Sep 24, 2003
    #13
  14. shank

    DU Guest

    brucie wrote:
    > In post <bkqq2t$smh$>
    > DU said...
    >
    >
    >>>if you consider the <body> element to be the available canvas area and
    >>>not the <html> element then padding is the space between the <body>
    >>>element and its content. that makes sense. i don't think anyone would
    >>>disagree with that.

    >
    >
    >
    >>Are you saying that borders and padding on the root element (html)
    >>should not be rendered?

    >
    >
    > if you consider the <html> element the available canvas area and stick
    > a margin or border on it then where is the margin or border supposed
    > to go? the margin and border would be outside the available canvas
    > area.
    >
    > <html> element as the available canvas area:
    >
    > +<html>---available canvas area +---+
    > margin - border | padding <body></body> padding | border - margin
    > +----------------------------</html>+
    >
    > <body> element as the available canvas area
    >
    > +<body>---available canvas area +---+
    > margin - border | padding <site content> padding | border - margin
    > +----------------------------</body>+
    >
    > some problem in each case. the border and margins are outside the
    > available canvas area.
    >
    >


    I see what you mean. But "available canvas area" is nowhere defined in
    the specs. Neither are "visible canvas area" or "rendered canvas area".
    "canvas" and "initial containing block" are though.

    The diagram of the box model is clear to me and AFAICS, the body and the
    html elements are block-level elements which should conform to the CSS1
    box model.

    >>Are you saying that margins on the body element
    >>shouldn't be rendered?

    >
    >
    > it all comes down to what is the available canvas area of the browser.
    > is it the <html> element or the <body> element?
    >


    A <p> with the rule position:absolute; top:-200px; left:200px; (as given
    in my previous post) should not be in your "available canvas area" then?

    > its logical to consider the <body> element the available canvas area,
    > not the <html> element. the <body> is the documents content, the bit
    > thats displayed in the available canvas area. applying a margin or
    > border would place the margin or border outside the available canvas
    > area.
    >
    >
    >>Are you saying that the body element can not
    >>render margins?

    >
    >
    > i'm saying that the <body> element is the available canvas area of the
    > browser, not the <html> element. applying a margin or border on the
    > <body> element would place them outside the available canvas area.
    >
    >
    >>Regardless of the way you define what is the available canvas area,

    >
    >
    > what the available canvas area is is the point of it all. it is either
    > the <html> element or the <body> element.
    >
    > if the available canvas area is the <html> element margins and borders
    > should not apply but can be applied to the <body> element.
    >
    > if the available canvas area is the <body> element then margins and
    > borders should not apply.
    >
    > you cant place margins and borders outside the available canvas area.
    >
    >


    DU
    --
    Javascript and Browser bugs:
    http://www10.brinkster.com/doctorunclear/
    - Resources, help and tips for Netscape 7.x users and Composer
    - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
    http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
    DU, Sep 24, 2003
    #14
  15. shank

    brucie Guest

    In post <bkqtmk$vk$>
    DU said...

    >> <html> element as the available canvas area:
    >>
    >> +<html>---available canvas area +---+
    >> margin - border | padding <body></body> padding | border - margin
    >> +----------------------------</html>+
    >>
    >> <body> element as the available canvas area
    >>
    >> +<body>---available canvas area +---+
    >> margin - border | padding <site content> padding | border - margin
    >> +----------------------------</body>+
    >>
    >> some problem in each case. the border and margins are outside the
    >> available canvas area.


    > I see what you mean. But "available canvas area" is nowhere defined in
    > the specs. Neither are "visible canvas area" or "rendered canvas area".
    > "canvas" and "initial containing block" are though.


    but what is the initial containing block? thats what i'm getting at.
    is it the <body> element or the <html> element or something
    mysterious?

    if its the <html> element then

    html{margin:10px;border:1px solid green;}

    should not apply. IE6 gets the margin right (ignores it) but screws up
    on the border. both opera and mozilla get it wrong, they apply both
    the margin and border.

    if the <body> element is the initial containing block then all three
    browsers screw it up, they apply the margin and border.

    > The diagram of the box model is clear to me and AFAICS, the body and the
    > html elements are block-level elements which should conform to the CSS1
    > box model.


    as browsers apply borders and margins to the <html> and <body>
    elements then the initial containing block at the moment can only be
    defined as "something mysterious"

    > A <p> with the rule position:absolute; top:-200px; left:200px; (as given
    > in my previous post) should not be in your "available canvas area" then?


    browsers don't display it, its removed from the normal document flow
    and placed outside the initial containing block. if it was part of the
    initial containing block the block is supposed to grow to hold its
    content and browsers are supposed to supply scrollbars if the initial
    containing block is smaller than the viewport.

    but! the initial containing block grows to accommodate elements
    absolutely or relatively positioned with positive values greater than
    the viewport and scrollbars are supplied. so why doesn't the initial
    containing block accommodate elements positioned with negative values
    or change the negative value to the nearest supported value which
    would be zero?

    my head hurts

    --
    24/September/2003 12:04:23 pm
    brucie, Sep 24, 2003
    #15
  16. shank

    Mark Parnell Guest

    brucie wrote:
    > In post <bkqtmk$vk$>
    > DU said...
    >>

    > but what is the initial containing block? thats what i'm getting at.
    > is it the <body> element or the <html> element or something
    > mysterious?
    >


    The way I think about it is that since you can set styles on the html
    element, but nothing bigger, <html> would be the initial containing block.
    Though it could be something mysterious, of course. :)

    > if its the <html> element then
    >
    > html{margin:10px;border:1px solid green;}
    >
    > should not apply. IE6 gets the margin right (ignores it) but screws up
    > on the border. both opera and mozilla get it wrong, they apply both
    > the margin and border.
    >
    > if the <body> element is the initial containing block then all three
    > browsers screw it up, they apply the margin and border.
    >


    Agreed.

    >
    > as browsers apply borders and margins to the <html> and <body>
    > elements then the initial containing block at the moment can only be
    > defined as "something mysterious"
    >


    So it seems. :-S

    >> A <p> with the rule position:absolute; top:-200px; left:200px; (as
    >> given in my previous post) should not be in your "available canvas
    >> area" then?

    >
    > browsers don't display it, its removed from the normal document flow
    > and placed outside the initial containing block. if it was part of the
    > initial containing block the block is supposed to grow to hold its
    > content and browsers are supposed to supply scrollbars if the initial
    > containing block is smaller than the viewport.
    >


    Yes...

    > but! the initial containing block grows to accommodate elements
    > absolutely or relatively positioned with positive values greater than
    > the viewport and scrollbars are supplied.


    Yes...

    > so why doesn't the initial
    > containing block accommodate elements positioned with negative values
    > or change the negative value to the nearest supported value which
    > would be zero?
    >


    Because then where the paragraph has been moved to would become the
    beginning of the canvas (i.e. top: 0;), so the paragraph would need to be
    moved another 200px up, so the canvas would expand again, so where the
    paragraph has been moved to would become the beginning of the canvas....

    > my head hurts


    I'm not surprised. Mine too.

    --

    Mark Parnell
    http://www.clarkecomputers.com.au
    Mark Parnell, Sep 24, 2003
    #16
  17. shank

    rf Guest

    "Mark Parnell" <> wrote in message
    news:3f7113d6$0$23605$...
    > brucie wrote:
    > > In post <bkqtmk$vk$>
    > > DU said...
    > >>

    > > but what is the initial containing block? thats what i'm getting at.
    > > is it the <body> element or the <html> element or something
    > > mysterious?
    > >

    >
    > The way I think about it is that since you can set styles on the html
    > element, but nothing bigger, <html> would be the initial containing block.
    > Though it could be something mysterious, of course. :)


    The (CSS2) spec is quite clear on this. The initial containing block is
    generated by the root of the document tree, the html element.

    <snip stuff>

    > > my head hurts

    >
    > I'm not surprised. Mine too.


    <aol>me too</aol>

    Cheers
    Richard.
    rf, Sep 24, 2003
    #17
  18. shank

    DU Guest

    brucie wrote:

    > In post <bkqtmk$vk$>
    > DU said...
    >
    >
    >>><html> element as the available canvas area:
    >>>
    >>> +<html>---available canvas area +---+
    >>>margin - border | padding <body></body> padding | border - margin
    >>> +----------------------------</html>+
    >>>
    >>><body> element as the available canvas area
    >>>
    >>> +<body>---available canvas area +---+
    >>>margin - border | padding <site content> padding | border - margin
    >>> +----------------------------</body>+
    >>>



    Section 14.2 of both CSS2 and CSS2.1 contradict the above.


    >>>some problem in each case. the border and margins are outside the
    >>>available canvas area.

    >
    >
    >>I see what you mean. But "available canvas area" is nowhere defined in
    >>the specs. Neither are "visible canvas area" or "rendered canvas area".
    >>"canvas" and "initial containing block" are though.

    >


    I think you should have defined this as "viewable canvas area" from the
    beginning: it seems to me to be a better wording of what you were trying
    to explain.

    >
    > but what is the initial containing block? thats what i'm getting at.
    > is it the <body> element or the <html> element or something
    > mysterious?
    >
    > if its the <html> element then
    >
    > html{margin:10px;border:1px solid green;}
    >
    > should not apply. IE6 gets the margin right (ignores it) but screws up
    > on the border. both opera and mozilla get it wrong, they apply both
    > the margin and border.
    >
    > if the <body> element is the initial containing block then all three
    > browsers screw it up, they apply the margin and border.
    >
    >
    >>The diagram of the box model is clear to me and AFAICS, the body and the
    >>html elements are block-level elements which should conform to the CSS1
    >>box model.

    >
    >
    > as browsers apply borders and margins to the <html> and <body>
    > elements then the initial containing block at the moment can only be
    > defined as "something mysterious"
    >
    >
    >>A <p> with the rule position:absolute; top:-200px; left:200px; (as given
    >>in my previous post) should not be in your "available canvas area" then?

    >
    >
    > browsers don't display it, its removed from the normal document flow
    > and placed outside the initial containing block.


    No. It is placed inside the initial containing block. That's per specs.

    [If we position "div1":
    #div1 { position: absolute; left: 50px; top: 50px }
    its containing block is no longer "body"; it becomes the initial
    containing block (since there are no other positioned ancestor boxes).]
    http://www.w3.org/TR/CSS21/visudet.html#containing-block-details


    if it was part of the
    > initial containing block the block is supposed to grow to hold its
    > content


    The "initial containing block" is not the document root element, is not
    the body element and is not an html element at all.

    and browsers are supposed to supply scrollbars if the initial
    > containing block is smaller than the viewport.
    >
    > but! the initial containing block grows to accommodate elements
    > absolutely or relatively positioned with positive values greater than
    > the viewport and scrollbars are supplied.


    Where do you read this? Section 10.1 of CSS2.1 clarified and corrected
    the previous CSS2 TR. So you must now refer to that section. The CSS2.1
    Working Draft of September 15th 2003 still kept what was in the previous
    CSS2.1 Working Draft.

    http://www.w3.org/TR/CSS21/visudet.html#containing-block-details

    so why doesn't the initial
    > containing block accommodate elements positioned with negative values
    > or change the negative value to the nearest supported value which
    > would be zero?
    >
    > my head hurts
    >


    "The containing block in which the root element lives is chosen by the
    user agent. (It could be related to the viewport.) This containing block
    is called the initial containing block."
    http://www.w3.org/TR/CSS21/visudet.html#containing-block-details

    This is the best schema for I.C.B.:

    +--------------------+
    | I.C.B. |
    | +--------------+ |
    | | html | |
    | |+------------+| |
    | || body || |
    | || || |
    | || || |
    | || || |
    | || || |
    | || || |
    | |+------------+| |
    | +--------------+ |
    | |
    +--------------------+


    DU
    --
    Javascript and Browser bugs:
    http://www10.brinkster.com/doctorunclear/
    - Resources, help and tips for Netscape 7.x users and Composer
    - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
    http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
    DU, Sep 24, 2003
    #18
  19. shank

    DU Guest

    rf wrote:
    > "Mark Parnell" <> wrote in message
    > news:3f7113d6$0$23605$...
    >
    >>brucie wrote:
    >>
    >>>In post <bkqtmk$vk$>
    >>>DU said...
    >>>
    >>>but what is the initial containing block? thats what i'm getting at.
    >>>is it the <body> element or the <html> element or something
    >>>mysterious?
    >>>

    >>
    >>The way I think about it is that since you can set styles on the html
    >>element, but nothing bigger, <html> would be the initial containing block.
    >>Though it could be something mysterious, of course. :)

    >
    >
    > The (CSS2) spec is quite clear on this.


    Quite clear but wrong. CSS2.1 corrected this.
    This has been discussed before a lot.

    The initial containing block is
    > generated by the root of the document tree, the html element.
    >


    As far as I understand things, root element and root of document tree
    are different things. Document root element is of nodeType ELEMENT_NODE
    (nodeName HTML): that is a certainty.
    As far as I understand things (and here I might be wrong), root of
    document tree is of nodeType DOCUMENT_NODE (nodeName #document).

    > <snip stuff>
    >
    >>>my head hurts

    >>
    >>I'm not surprised. Mine too.

    >
    >
    > <aol>me too</aol>
    >
    > Cheers
    > Richard.
    >
    >


    DU
    --
    Javascript and Browser bugs:
    http://www10.brinkster.com/doctorunclear/
    - Resources, help and tips for Netscape 7.x users and Composer
    - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
    http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
    DU, Sep 24, 2003
    #19
  20. shank

    brucie Guest

    In post <bkr7ht$41d$>
    DU said...

    > Section 14.2 of both CSS2 and CSS2.1 contradict the above.


    to cut a long debate short i do not agree with the CSS1/2
    recommendations or browser behavior and CSS2.1 is a working draft yet
    to be submitted for consideration. it is not a recommendation or
    specification to be followed at the moment.

    --
    24/September/2003 03:56:03 pm
    brucie, Sep 24, 2003
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sviau
    Replies:
    5
    Views:
    511
    Steven Cheng[MSFT]
    Feb 10, 2004
  2. Pradeep
    Replies:
    8
    Views:
    582
    Oliver Wong
    Apr 18, 2006
  3. Tom
    Replies:
    2
    Views:
    388
    Steve Pugh
    May 5, 2004
  4. Titus A Ducksass - AKA broken-record
    Replies:
    6
    Views:
    649
    Titus A Ducksass - AKA broken-record
    Nov 15, 2004
  5. Replies:
    7
    Views:
    1,033
Loading...

Share This Page