auto margins in IE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Harris Kosmidhs

    auto margins in IE

    Hello.

    sorry if this has been answered previously. I use a main wrapper div to
    put the whole site in it. And I use
    margin: 0 auto 0 auto
    in order to center the page. But in IE it fails. Is there a workaround
    for this?

    Thanks
  • Els

    #2
    Re: auto margins in IE

    Harris Kosmidhs wrote:
    sorry if this has been answered previously. I use a main wrapper div to
    put the whole site in it. And I use
    margin: 0 auto 0 auto
    in order to center the page. But in IE it fails. Is there a workaround
    for this?
    You are probably not using a complete doctype declaration (which makes
    IE render in quirksmode), or you are using IE5.

    Solution one: start your page with a doctype such as:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    (which won't help in IE5 btw)

    Solution two: http://locusmeus.com/html-css/centeringpage.html

    --
    Els http://locusmeus.com/
    accessible web design: http://locusoptimus.com/

    Comment

    • =?UTF-8?B?R8OpcmFyZCBUYWxib3Q=?=

      #3
      Re: auto margins in IE

      Els wrote :
      Harris Kosmidhs wrote:
      >
      >sorry if this has been answered previously. I use a main wrapper div to
      >put the whole site in it. And I use
      >margin: 0 auto 0 auto
      >in order to center the page. But in IE it fails. Is there a workaround
      >for this?
      >
      You are probably not using a complete doctype declaration (which makes
      IE render in quirksmode), or you are using IE5.
      >
      Solution one: start your page with a doctype such as:
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
      "http://www.w3.org/TR/html4/strict.dtd">
      (which won't help in IE5 btw)
      >
      Solution two: http://locusmeus.com/html-css/centeringpage.html

      A unanimity of web browser stats related sites consider that MSIE 5.x
      represent now about 1% of world browser usage stats.





      etc.

      I believe it is very much time to stop thinking about how valid markup
      code and valid CSS code (triggering standards compliant rendering mode
      in browsers supporting doctype switching) are going to be rendered in
      buggy, non-compliant browsers like MSIE 5.x and to tell web authors to
      use a strict DTD and to use valid markup code and valid CSS code or to
      tell users to upgrade or to switch to a better browser (Firefox 2 or
      Opera 9 or Safari 2).

      Using Web Standards in your Web Pages
      Section 2.2.3.2 I use <centeror align="center". How to align with CSS?
      The MDN Web Docs site provides information about Open Web technologies including HTML, CSS, and APIs for both Web sites and progressive web apps.


      The CSS1 text-align property specifies how text or inline elements (like
      an image) are aligned within an element.

      CSS "margin-left: auto; margin-right: auto;" properties will center a
      block-level element within its containing block. Defining margin-left
      and margin-right is for block-level elements. When both margin-left and
      margin-right are auto, they are set to equal values, thus centering a
      block-level element within its parent.

      References:
      CSS1 horizontal formating


      Worth mentioning is the excellent tutorial:
      Centring using CSS by D. Dorward


      Also Interactive demo on CSS horizontal alignment and horizontal formating


      Gérard
      --
      Using Web Standards in your Web Pages (Updated Dec. 2006)
      The MDN Web Docs site provides information about Open Web technologies including HTML, CSS, and APIs for both Web sites and progressive web apps.

      Comment

      • Els

        #4
        Re: auto margins in IE

        Gérard Talbot wrote:
        A unanimity of web browser stats related sites consider that MSIE 5.x
        represent now about 1% of world browser usage stats.
        >

        >

        >
        etc.
        >
        I believe it is very much time to stop thinking about how valid markup
        code and valid CSS code (triggering standards compliant rendering mode
        in browsers supporting doctype switching) are going to be rendered in
        buggy, non-compliant browsers like MSIE 5.x and to tell web authors to
        use a strict DTD and to use valid markup code and valid CSS code or to
        tell users to upgrade or to switch to a better browser (Firefox 2 or
        Opera 9 or Safari 2).
        I agree completely - but I've seen people say this on Usenet for the
        past 4 years now (they probably were doing it before that but I wasn't
        on the Internet yet then), and it still doesn't seem to sink in with
        'some' people. Any suggestions on how to get through to people on
        this? :-)

        BTW, I also still have clients who tell me what goes wrong on a page
        in IE5 (although mostly MacIE5 admittedly, which has less than 0.1% in
        any stats I have access to) - I must assume this is because they have
        access to it :-(


        --
        Els http://locusmeus.com/
        accessible web design: http://locusoptimus.com/

        Comment

        • dorayme

          #5
          Re: auto margins in IE

          In article <b9gu1aa9czqo$. 16nhkvsagpzm0.d lg@40tude.net>,
          Els <els.aNOSPAM@ti scali.nlwrote:
          BTW, I also still have clients who tell me what goes wrong on a page
          in IE5 (although mostly MacIE5 admittedly, which has less than 0.1% in
          any stats I have access to) - I must assume this is because they have
          access to it :-(
          Mostly MacIE eh? For these cases to show up, it means you are
          doing extremely well in your business with lots of clients, Els.
          Just btw, How many dwarfs, hermaphrodites and martians for
          clients?

          <g>

          --
          dorayme

          Comment

          • Els

            #6
            Re: auto margins in IE

            dorayme wrote:
            In article <b9gu1aa9czqo$. 16nhkvsagpzm0.d lg@40tude.net>,
            Els <els.aNOSPAM@ti scali.nlwrote:
            >
            >BTW, I also still have clients who tell me what goes wrong on a page
            >in IE5 (although mostly MacIE5 admittedly, which has less than 0.1% in
            >any stats I have access to) - I must assume this is because they have
            >access to it :-(
            >
            Mostly MacIE eh? For these cases to show up, it means you are
            doing extremely well in your business with lots of clients, Els.
            Or it could just mean that my only client uses a Mac :P

            No, not most of my clients complain about MacIE, but of the one(s)
            that noticed IE5, most mean MacIE5. (where most is a number between
            50% and 100% sort of ;-))
            Just btw, How many dwarfs, hermaphrodites and martians for
            clients?
            No idea - never met them. I sort of assume them to be regular sized
            earthlings, but to be honest, I never asked! :-)


            --
            Els http://locusmeus.com/
            accessible web design: http://locusoptimus.com/

            Comment

            • dorayme

              #7
              Re: auto margins in IE

              In article <1e3dpzbimit8t. rsybms76frmy.dl g@40tude.net>,
              Els <els.aNOSPAM@ti scali.nlwrote:
              dorayme wrote:
              >
              In article <b9gu1aa9czqo$. 16nhkvsagpzm0.d lg@40tude.net>,
              Els <els.aNOSPAM@ti scali.nlwrote:
              BTW, I also still have clients who tell me what goes wrong on a page
              in IE5 (although mostly MacIE5 admittedly, which has less than 0.1% in
              any stats I have access to) - I must assume this is because they have
              access to it :-(
              Mostly MacIE eh? For these cases to show up, it means you are
              doing extremely well in your business with lots of clients, Els.
              >
              Or it could just mean that my only client uses a Mac :P
              >
              True, it could be that your experience does not reflect the
              general stats. I have only ever had one client on a Mac (and that
              one never used IE, Netscape was the big one for so many old mac
              users).

              --
              dorayme

              Comment

              • Els

                #8
                Re: auto margins in IE

                dorayme wrote:

                [I have some clients using a Mac, and MacIE counts for 0.1% of site
                visitors]
                True, it could be that your experience does not reflect the
                general stats.
                I'm quite sure of that, yes - I'd have a heard time meeting my
                deadlines if it did! :-)
                I have only ever had one client on a Mac (and that
                one never used IE, Netscape was the big one for so many old mac
                users).
                I work with designers, and they often enough use Macs. Then there's
                the buzz of 'standard compliant sites work in all browsers', and
                recently one designer client put one and one together and tested the
                site in MacIE (which she wouldn't have used otherwise) <g>

                --
                Els http://locusmeus.com/
                accessible web design: http://locusoptimus.com/

                Comment

                • dorayme

                  #9
                  Re: auto margins in IE

                  In article <xe6de05kpcm9$. xmq47gbaww0i$.d lg@40tude.net>,
                  Els <els.aNOSPAM@ti scali.nlwrote:
                  I work with designers, and they often enough use Macs. Then there's
                  the buzz of 'standard compliant sites work in all browsers', and
                  recently one designer client put one and one together and tested the
                  site in MacIE (which she wouldn't have used otherwise) <g>
                  I see. My one Mac client used to now and again say that something
                  I did for him was not quite right in NS4 (even at a time he was
                  getting used to Safari).

                  I know you used to use Macs once, but perhaps you and others
                  might not know that as a last death throw, MS put out a OS X
                  version of their MacIE 5 browser. Had they not done so, it is
                  much less likely that you would be getting even the few calls
                  about it that you get. To run the old browsers on Mac, one needs
                  to activate what is called Classic, a complicated and clever
                  hardware/software function in X. Machines even before the new
                  Intel based ones were ceasing to allow folk to boot into any pre
                  X system, and now even Classic is no longer being supported.

                  Basically I am saying, there would have been even less users of
                  Mac IE had they left it alone for pre X. It might now go on
                  living for ever and ever. Think about that!

                  --
                  dorayme

                  Comment

                  • Bergamot

                    #10
                    Re: auto margins in IE

                    Els wrote:
                    >
                    the buzz of 'standard compliant sites work in all browsers'
                    Remind them that "working in all browsers" is not the same thing as
                    "looking the same (or even similar) in all browsers".

                    --
                    Berg

                    Comment

                    • Els

                      #11
                      Re: auto margins in IE

                      dorayme wrote:
                      In article <xe6de05kpcm9$. xmq47gbaww0i$.d lg@40tude.net>,
                      Els <els.aNOSPAM@ti scali.nlwrote:
                      >
                      >I work with designers, and they often enough use Macs. Then there's
                      >the buzz of 'standard compliant sites work in all browsers', and
                      >recently one designer client put one and one together and tested the
                      >site in MacIE (which she wouldn't have used otherwise) <g>
                      >
                      I see. My one Mac client used to now and again say that something
                      I did for him was not quite right in NS4 (even at a time he was
                      getting used to Safari).
                      >
                      I know you used to use Macs once,
                      Maybe you have me confused with someone else? The only time I ever
                      used a Mac was back in 1988, and not to surf any websites. I believe
                      that what I was using was called 'FileMaker'? Keeping track of
                      addresses and stuff. I also recall a layout program (for printed
                      magazines) in which you could let text continue from one column to
                      another by making a 'link' between them. I clearly remember the
                      program not being able to cope with my experiment: linking the last
                      column to the first one, making a full circle :-)
                      but perhaps you and others
                      might not know that as a last death throw, MS put out a OS X
                      version of their MacIE 5 browser.
                      Indeed, I didn't know, nor would I have expected it! Is that version
                      any better the previous one?

                      [snip]
                      Basically I am saying, there would have been even less users of
                      Mac IE had they left it alone for pre X. It might now go on
                      living for ever and ever. Think about that!
                      I'd rather not! :-)

                      --
                      Els http://locusmeus.com/
                      accessible web design: http://locusoptimus.com/

                      Comment

                      • Sherm Pendley

                        #12
                        Re: auto margins in IE

                        Els <els.aNOSPAM@ti scali.nlwrites:
                        dorayme wrote:
                        >
                        >but perhaps you and others
                        >might not know that as a last death throw, MS put out a OS X
                        >version of their MacIE 5 browser.
                        >
                        Indeed, I didn't know, nor would I have expected it! Is that version
                        any better the previous one?
                        No, it's exactly the same as far as stylesheet authoring is concerned; the
                        only difference is that it was recompiled using the Carbon toolkit so as
                        to run as a native app instead of needing the Classic environment.

                        sherm--

                        --
                        Web Hosting by West Virginians, for West Virginians: http://wv-www.net
                        Cocoa programming in Perl: http://camelbones.sourceforge.net

                        Comment

                        • Dick Gaughan

                          #13
                          Re: auto margins in IE

                          In <b9gu1aa9czqo$. 16nhkvsagpzm0.d lg@40tude.neton Wed, 4 Apr 2007
                          09:04:20 +0200, Els <els.aNOSPAM@ti scali.nlwrote:
                          >Gérard Talbot wrote:
                          >
                          >I believe it is very much time to stop thinking about how valid markup
                          >code and valid CSS code (triggering standards compliant rendering mode
                          >in browsers supporting doctype switching) are going to be rendered in
                          >buggy, non-compliant browsers like MSIE 5.x and to tell web authors to
                          >use a strict DTD and to use valid markup code and valid CSS code or to
                          >tell users to upgrade or to switch to a better browser (Firefox 2 or
                          >Opera 9 or Safari 2).
                          >
                          >I agree completely - but I've seen people say this on Usenet for the
                          >past 4 years now (they probably were doing it before that but I wasn't
                          >on the Internet yet then), and it still doesn't seem to sink in with
                          >'some' people. Any suggestions on how to get through to people on
                          >this? :-)
                          Although I'm getting less inclined to do it, for the benefit of
                          older non-compliant browsers I still use the @import hack :( on
                          some sites to let them default to a stylesheet which has minimal
                          styling and displays a short message which explains that their
                          browser is not standards-compliant and that, while the content
                          will still be perfectly readable, they're missing out on all my
                          stunning styling and layout.

                          If they give a shit and are able to, it might help the ignorant
                          realise that using a standards-compliant browser might be A Good
                          Thing. Maybe nobody ever told them. There are still some poor
                          souls out there who wouldn't know the difference between a
                          compliant browser and a 47 bus and I believe in assisting them
                          find a clue whenever possible if it doesn't cause me too much
                          extra work.

                          (And yes, I do include skip links for those using speech browsers
                          :)

                          --
                          DG

                          Comment

                          • Bergamot

                            #14
                            Re: auto margins in IE

                            Dick Gaughan wrote:
                            >
                            I still use the @import hack :( on
                            some sites to let them default to a stylesheet which has minimal
                            styling and displays a short message
                            I also use @import with a minimal default stylesheet, but skip the
                            message. I'm sure anyone still using one of those archaic browsers is
                            already well aware that they are missing "something" .
                            I believe in assisting them
                            find a clue whenever possible if it doesn't cause me too much
                            extra work.
                            Then again, it might be considered arrogance on your part, rather than
                            helpfulness. To me, it comes across the same as the annoying "best
                            viewed in [some browser I won't use]", regardless of how nicely you may
                            have worded it.

                            my 2p

                            --
                            Berg

                            Comment

                            • Dick Gaughan

                              #15
                              Re: auto margins in IE

                              In <57hvjnF2cp16rU 1@mid.individua l.neton Wed, 04 Apr 2007
                              10:44:15 -0600, Bergamot <bergamot@visi. comwrote:
                              >Then again, it might be considered arrogance on your part, rather than
                              >helpfulness. To me, it comes across the same as the annoying "best
                              >viewed in [some browser I won't use]", regardless of how nicely you may
                              >have worded it.
                              Your argument does have some merit, but there is a difference in
                              that one is still delivering the content in perfectly readable
                              form in whatever browser you're already using, is merely a
                              gently-worded hint that, unless they have a reason for doing
                              otherwise, they might want to consider doing the right thing, is
                              visible only to the target audience and can be totally ignored
                              without consequence.

                              The other is a scattergun instruction that they do the wrong thing
                              and often denies them content until they do.

                              On balance I still believe that trying to provide clues for the
                              clueless is not a bad thing to do, but then I've been on the
                              planet long enough to know that whatever you do, someone somewhere
                              is going to tell you that you shouldn't have.

                              --
                              DG

                              Comment

                              Working...