body margins....

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Frances Del Rio

    body margins....

    when I test my stuff with the validator in HomeSite it tells me the body
    tag no longer reads margin attributes.. does this mean now margins are
    to be specified only in CSS?

    I work for an internet co., they support IE 5+ and the old pre-6
    Netscape..

    if you don't put this tag in html docs, what version of HTML does it
    default to?
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    (just wondering... because the HomeSite debugger always says that
    such-and-such is longer valid in "currently active versions" (of HTML, I
    suppose, although it doesn't say...))
    thank you..

    Frances Del Rio
    NYC

  • Mark Tranchant

    #2
    Re: body margins....

    Frances Del Rio wrote:
    [color=blue]
    > when I test my stuff with the validator in HomeSite it tells me the body
    > tag no longer reads margin attributes.. does this mean now margins are
    > to be specified only in CSS?[/color]

    That's preferred, but it depends entirely on which (X)HTML version
    you're coding to.
    [color=blue]
    > I work for an internet co., they support IE 5+ and the old pre-6 Netscape..[/color]

    Why not support web browsers in general?
    [color=blue]
    > if you don't put this tag in html docs, what version of HTML does it
    > default to?
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">[/color]

    By "it" I presume you mean HomeSite? No idea. You should always declare
    a DOCTYPE, and 4.0 Transitional is probably one of the poorer choices
    you can make. Try 4.01 Strict instead:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    [color=blue]
    > (just wondering... because the HomeSite debugger always says that
    > such-and-such is longer valid in "currently active versions" (of HTML, I
    > suppose, although it doesn't say...))[/color]

    4.0 Transitional isn't a "currently active version" by my definition.
    4.01 Strict is the version to which new pages should be written.



    --
    Mark.

    Comment

    • Steve Pugh

      #3
      Re: body margins....

      Frances Del Rio <fdr58@yahoo.co m> wrote:
      [color=blue]
      >when I test my stuff with the validator in HomeSite[/color]

      Be aware that in technically that is not a validator.
      [color=blue]
      >it tells me the body tag no longer reads margin attributes..[/color]

      They were never valid.
      [color=blue]
      >does this mean now margins are to be specified only in CSS?[/color]

      Yes.
      [color=blue]
      >I work for an internet co., they support IE 5+ and the old pre-6
      >Netscape..[/color]

      Okay. But does "support" = "must look identical in" ?
      [color=blue]
      >if you don't put this tag in html docs, what version of HTML does it
      >default to?[/color]

      None (i.e. it's not HTML if it doesn't have a doctype) or HTML 2.0
      depending on how you interpret the mess of standards and non-standards
      that have been released over the years.
      [color=blue]
      ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
      >(just wondering... because the HomeSite debugger always says that
      >such-and-such is longer valid in "currently active versions" (of HTML, I
      >suppose, although it doesn't say...))[/color]

      The 'currently active versions' are just whatever versions you've
      configured the Homesite checker to check against. The Homesite checker
      doesn't care about the doctype in the document, only about how you've
      configured the checker.

      Steve

      --
      "My theories appal you, my heresies outrage you,
      I never answer letters and you don't like my tie." - The Doctor

      Steve Pugh <steve@pugh.net > <http://steve.pugh.net/>

      Comment

      • Neal

        #4
        Re: body margins....

        On Thu, 01 Jul 2004 10:33:22 -0400, Frances Del Rio <fdr58@yahoo.co m>
        wrote:
        [color=blue]
        > if you don't put this tag in html docs, what version of HTML does it
        > default to?
        > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">[/color]

        Just for your edification, this isn't a tag really. It's simply a
        declaration of what kind of code you're using.

        And preferable to what you posted above is:

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

        because in some cases the UA is looking for that match to knock it out of
        a quirky mode.

        Comment

        • DU

          #5
          Re: body margins....

          Frances Del Rio wrote:[color=blue]
          > when I test my stuff with the validator in HomeSite it tells me the body
          > tag no longer reads margin attributes.. does this mean now margins are
          > to be specified only in CSS?
          >[/color]

          Yes. marginheight, marginwidth, topmargin, leftmargin, etc... are not
          supported by MSIE 5+ but are supported by NS 4, NS 6, NS 7. So, if you
          define these attributes in your document, say, like this:

          <body marginheight="0 " marginwidth="0" topmargin="0" leftmargin="0" ...>
          then MSIE 5+ will have 15px of margin for top and bottom of the body
          node and a 10px margin for left and right margin while NS 4, NS 6, NS
          7.x, Mozilla-based browsers will have 0 margins.

          One simple, obvious and reliable benefit of coding according to W3C web
          standards is that you avoid all this without even knowing which browsers
          and which versions of which browsers support what exactly. You just code
          according to W3C web standards and you just let browser manufacturers
          update and upgrade their browsers (and they do!) according to web
          standards and you invite people to upgrade their browser versions (and
          they do!). If you do your part, then your code will be supported and
          rendered accordingly thanks to/by other complying parties.

          The stupid thing about margins is that NS 4 does support CSS margins
          applied to the body; people are still using, relying on invalid code
          which really no longer makes any kind of sense.




          [color=blue]
          > I work for an internet co., they support IE 5+ and the old pre-6 Netscape..
          >
          > if you don't put this tag in html docs, what version of HTML does it
          > default to?
          > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">[/color]

          By definition, a valid document requires a doctype declaration. The best
          doctype declaration I recommend is using strict HTML 4.01 all the time
          because it will trigger standards compliant rendering mode in all
          browsers supporting doctype switching that way. In the case of MSIE 6,
          this is important because in standards compliant rendering mode, it
          corrects an important implementation flaw of the CSS1 box model... and
          MSIE 6 is by far the most frequently used on the web.

          My Web site is standard! And yours?


          List of valid DTDs you can use in your document.


          Don't forget to add a doctype


          DU
          [color=blue]
          > (just wondering... because the HomeSite debugger always says that
          > such-and-such is longer valid in "currently active versions" (of HTML, I
          > suppose, although it doesn't say...))
          > thank you..
          >
          > Frances Del Rio
          > NYC
          >[/color]

          Comment

          • Steve Pugh

            #6
            Re: body margins....

            DU <drunclear@hotW IPETHISmail.com > wrote:[color=blue]
            >Frances Del Rio wrote:[color=green]
            >> when I test my stuff with the validator in HomeSite it tells me the body
            >> tag no longer reads margin attributes.. does this mean now margins are
            >> to be specified only in CSS?[/color]
            >
            >Yes. marginheight, marginwidth, topmargin, leftmargin, etc... are not
            >supported by MSIE 5+ but are supported by NS 4, NS 6, NS 7. So, if you
            >define these attributes in your document, say, like this:[/color]

            No. topmargin and leftmargin are supported by IE5+ just as they were
            supported by IE4. (top and left were supported from IE2, but IE4 added
            right and bottom). IE6 and Opera 7 later added support for left and
            top but not right and bottom.

            (When only top and left are specified they affect all four margins not
            just the top and left ones, I'm not sure if this is true all the way
            back to IE2 or whether it's a later change.)

            marginwidth and marginheight were added as attributes of body (as
            opposed to attributes of frame) by NN4 but are also supported by Opera
            4+.
            [color=blue]
            ><body marginheight="0 " marginwidth="0" topmargin="0" leftmargin="0" ...>
            >then MSIE 5+ will have 15px of margin for top and bottom of the body
            >node and a 10px margin for left and right margin while NS 4, NS 6, NS 7.x,
            >Mozilla-based browsers will have 0 margins.[/color]

            No. MSIE will also display zero margins with the above code. Try it
            and see for yourself.
            [color=blue]
            >One simple, obvious and reliable benefit of coding according to W3C web
            >standards is that you avoid all this without even knowing which browsers
            >and which versions of which browsers support what exactly.[/color]

            However, you do have to remember that in CSS terms IE and Gecko have
            default margins whilst Opera has default padding.
            [color=blue]
            >The stupid thing about margins is that NS 4 does support CSS margins
            >applied to the body;[/color]

            No it doesn't. Try it and see. The only CSS way of placing content
            right up against the window edge in NN4 is absolute positioning.

            Steve

            --
            "My theories appal you, my heresies outrage you,
            I never answer letters and you don't like my tie." - The Doctor

            Steve Pugh <steve@pugh.net > <http://steve.pugh.net/>

            Comment

            • Eric B. Bednarz

              #7
              Re: body margins....

              Steve Pugh <steve@pugh.net > writes:

              [NN4]
              [color=blue]
              > The only CSS way of placing content
              > right up against the window edge in NN4 is absolute positioning.[/color]

              You could as well use negative margins (might be safer e.g. in
              combination with scripts, and should not break tabbing through
              linkfarms).


              --
              | ) 111010111011 | http://bednarz.nl/
              -(
              | ) Distribute me: http://binaries.bednarz.nl/mp3/aicha

              Comment

              • DU

                #8
                Re: body margins....

                Steve Pugh wrote:[color=blue]
                > DU <drunclear@hotW IPETHISmail.com > wrote:
                >[color=green]
                >>Frances Del Rio wrote:
                >>[color=darkred]
                >>>when I test my stuff with the validator in HomeSite it tells me the body
                >>>tag no longer reads margin attributes.. does this mean now margins are
                >>>to be specified only in CSS?[/color]
                >>
                >>Yes. marginheight, marginwidth, topmargin, leftmargin, etc... are not
                >>supported by MSIE 5+ but are supported by NS 4, NS 6, NS 7. So, if you
                >>define these attributes in your document, say, like this:[/color]
                >
                >
                > No. topmargin and leftmargin are supported by IE5+ just as they were
                > supported by IE4. (top and left were supported from IE2, but IE4 added
                > right and bottom). IE6 and Opera 7 later added support for left and
                > top but not right and bottom.
                >[/color]

                Ok, I was not sure about these. I'll check this for sure.
                [color=blue]
                > (When only top and left are specified they affect all four margins not
                > just the top and left ones, I'm not sure if this is true all the way
                > back to IE2 or whether it's a later change.)
                >
                > marginwidth and marginheight were added as attributes of body (as
                > opposed to attributes of frame) by NN4 but are also supported by Opera
                > 4+.
                >
                >[color=green]
                >><body marginheight="0 " marginwidth="0" topmargin="0" leftmargin="0" ...>
                >>then MSIE 5+ will have 15px of margin for top and bottom of the body
                >>node and a 10px margin for left and right margin while NS 4, NS 6, NS 7.x,
                >>Mozilla-based browsers will have 0 margins.[/color]
                >
                >
                > No. MSIE will also display zero margins with the above code. Try it
                > and see for yourself.
                >
                >[color=green]
                >>One simple, obvious and reliable benefit of coding according to W3C web
                >>standards is that you avoid all this without even knowing which browsers
                >>and which versions of which browsers support what exactly.[/color]
                >
                >
                > However, you do have to remember that in CSS terms IE and Gecko have
                > default margins whilst Opera has default padding.
                >[/color]

                That I know.
                Despite errors or imprecisions regarding supported attributes, my
                reasoning regarding W3C web standards compliance is still very strong:
                if you want future-proof code that can now and will later be supported
                and rendered in an overwhelming majority of browsers in use out there,
                then going with W3C web standards is the safe, solid, reliable way.
                [color=blue]
                >[color=green]
                >>The stupid thing about margins is that NS 4 does support CSS margins
                >>applied to the body;[/color]
                >
                >
                > No it doesn't.[/color]

                Well, I tried setting margins many years ago on NS 4.72 on the body node
                and it worked.

                Try it and see. The only CSS way of placing content[color=blue]
                > right up against the window edge in NN4 is absolute positioning.
                >
                > Steve
                >[/color]

                That could be another issue...not sure what you mean by placing content.
                I was referring to rendering of margin for the body node. This reference
                supports my claim:



                DU

                Comment

                • Steve Pugh

                  #9
                  Re: body margins....

                  DU <drunclear@hotW IPETHISmail.com > wrote:[color=blue]
                  >Steve Pugh wrote:[color=green]
                  >> DU <drunclear@hotW IPETHISmail.com > wrote:[color=darkred]
                  >>>
                  >>>The stupid thing about margins is that NS 4 does support CSS margins
                  >>>applied to the body;[/color]
                  >>
                  >> No it doesn't.[/color]
                  >
                  >Well, I tried setting margins many years ago on NS 4.72 on the body node
                  >and it worked.[/color]

                  Zero or non-zero margins?
                  [color=blue]
                  >Try it and see. The only CSS way of placing content[color=green]
                  >> right up against the window edge in NN4 is absolute positioning.
                  >>[/color]
                  >That could be another issue...not sure what you mean by placing content.[/color]

                  <body><div>cont ent

                  I want the content div to be right up in the top left corner with no
                  space between it and the window frame.
                  [color=blue]
                  >I was referring to rendering of margin for the body node. This reference
                  >supports my claim:
                  >
                  >http://devedge.netscape.com/library/...otes.html#5505[/color]

                  Not really, it's very vaguely worded. The only part that would apply
                  in this case is "Navigator does fairly well".
                  NN4 is okay so long as you want to increase the default margins of any
                  element, but as soon as you want to reduce them you often run into
                  problems.

                  body {margin: 0; padding: 0;} simply has no effect at all in NN4. Try
                  it and see.

                  Steve

                  --
                  "My theories appal you, my heresies outrage you,
                  I never answer letters and you don't like my tie." - The Doctor

                  Steve Pugh <steve@pugh.net > <http://steve.pugh.net/>

                  Comment

                  • DU

                    #10
                    Re: body margins....

                    Steve Pugh wrote:[color=blue]
                    > DU <drunclear@hotW IPETHISmail.com > wrote:
                    >[color=green]
                    >>Steve Pugh wrote:
                    >>[color=darkred]
                    >>>DU <drunclear@hotW IPETHISmail.com > wrote:
                    >>>
                    >>>>The stupid thing about margins is that NS 4 does support CSS margins
                    >>>>applied to the body;
                    >>>
                    >>>No it doesn't.[/color]
                    >>
                    >>Well, I tried setting margins many years ago on NS 4.72 on the body node
                    >>and it worked.[/color]
                    >
                    >
                    > Zero or non-zero margins?
                    >[/color]

                    Non-zero; margin: 4% IIRC.
                    [color=blue]
                    >[color=green]
                    >>Try it and see. The only CSS way of placing content
                    >>[color=darkred]
                    >>>right up against the window edge in NN4 is absolute positioning.
                    >>>[/color]
                    >>
                    >>That could be another issue...not sure what you mean by placing content.[/color]
                    >
                    >
                    > <body><div>cont ent
                    >
                    > I want the content div to be right up in the top left corner with no
                    > space between it and the window frame.
                    >[/color]

                    Yeah.. that would be a problem since there is a gap created by
                    block-level elements and line-height too. You can't have text perfectly
                    right up in the top left corner with no space between it and the window
                    frame unless you use abs. positioning and there, NN 4 is known to be
                    weak and buggy.
                    [color=blue]
                    >[color=green]
                    >>I was referring to rendering of margin for the body node. This reference
                    >>supports my claim:
                    >>
                    >>http://devedge.netscape.com/library/...otes.html#5505[/color]
                    >
                    >
                    > Not really, it's very vaguely worded. The only part that would apply
                    > in this case is "Navigator does fairly well".
                    > NN4 is okay so long as you want to increase the default margins of any
                    > element, but as soon as you want to reduce them you often run into
                    > problems.
                    >[/color]

                    That's possible; I did not test extensively, exhaustively its support
                    for margins.
                    [color=blue]
                    > body {margin: 0; padding: 0;} simply has no effect at all in NN4. Try
                    > it and see.
                    >
                    > Steve
                    >[/color]

                    Argh... I am sure I did not try margin: 0 because at the time, we were
                    trying to create cross-browser code with MSIE 5.5 and MSIE 6.
                    Removing margin on the body (and padding for Opera 7.x) just makes
                    reading a webpage harder.

                    DU

                    Comment

                    Working...