By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,626 Members | 1,146 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,626 IT Pros & Developers. It's quick & easy.

auto margins in IE

P: n/a
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
Apr 3 '07 #1
Share this Question
Share on Google+
27 Replies


P: n/a
Els
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/
Apr 3 '07 #2

P: n/a
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.

http://www.thecounter.com/stats/2007/March/browser.php

http://marketshare.hitslink.com/report.aspx?qprid=6

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?
http://developer.mozilla.org/en/docs...your_Web_Pages

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
http://www.w3.org/TR/REC-CSS1#horizontal-formatting

Worth mentioning is the excellent tutorial:
Centring using CSS by D. Dorward
http://dorward.me.uk/www/centre/

Also Interactive demo on CSS horizontal alignment and horizontal formating
http://www.gtalbot.org/NvuSection/Nv...Alignment.html

Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
Apr 3 '07 #3

P: n/a
Els
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.

http://www.thecounter.com/stats/2007/March/browser.php

http://marketshare.hitslink.com/report.aspx?qprid=6

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/
Apr 4 '07 #4

P: n/a
In article <b9*****************************@40tude.net>,
Els <el*********@tiscali.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
Apr 4 '07 #5

P: n/a
Els
dorayme wrote:
In article <b9*****************************@40tude.net>,
Els <el*********@tiscali.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/
Apr 4 '07 #6

P: n/a
In article <1e****************************@40tude.net>,
Els <el*********@tiscali.nlwrote:
dorayme wrote:
In article <b9*****************************@40tude.net>,
Els <el*********@tiscali.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
Apr 4 '07 #7

P: n/a
Els
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/
Apr 4 '07 #8

P: n/a
In article <xe*****************************@40tude.net>,
Els <el*********@tiscali.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
Apr 4 '07 #9

P: n/a
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
Apr 4 '07 #10

P: n/a
Els
dorayme wrote:
In article <xe*****************************@40tude.net>,
Els <el*********@tiscali.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/
Apr 4 '07 #11

P: n/a
Els <el*********@tiscali.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
Apr 4 '07 #12

P: n/a
In <b9*****************************@40tude.neton Wed, 4 Apr 2007
09:04:20 +0200, Els <el*********@tiscali.nlwrote:
>Grard 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
Apr 4 '07 #13

P: n/a
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
Apr 4 '07 #14

P: n/a
In <57*************@mid.individual.neton Wed, 04 Apr 2007
10:44:15 -0600, Bergamot <be******@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
Apr 4 '07 #15

P: n/a
Els
Sherm Pendley wrote:
Els <el*********@tiscali.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.
Thanks - at least that saves me from "having to" test in more than one
MacIE then, which means that once I'm buying a Mac, I won't have to
weigh the pros and cons of buying a new OS or an old one :-)

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Apr 4 '07 #16

P: n/a
Els
Bergamot wrote:
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".
Of course - just saying what caused her to even check the site in that
browser. Either way, the differences were just minor and easily
solved, so /if/ I can make it look "exactly" the same without much
effort, why not do it :-)

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Apr 4 '07 #17

P: n/a
Els wrote:
Bergamot wrote:
>Remind them that "working in all browsers" is not the same thing as
"looking the same (or even similar) in all browsers".

/if/ I can make it look "exactly" the same without much
effort, why not do it :-)
If it takes more than 5 or 10 minutes to beat Mac IE into submission, I
give up on it altogether and let it get just a simplified stylesheet.
It's just not worth the anguish any more.

BTW, most of the trouble I have with it is with its *painfully* buggy
overflow handling.

--
Berg
Apr 4 '07 #18

P: n/a
Dick Gaughan wrote:
>
whatever you do, someone somewhere
is going to tell you that you shouldn't have.
Ain't it the truth. :-)

--
Berg
Apr 4 '07 #19

P: n/a
Els <el*********@tiscali.nlwrites:
Sherm Pendley wrote:
>Els <el*********@tiscali.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.

Thanks - at least that saves me from "having to" test in more than one
MacIE then, which means that once I'm buying a Mac, I won't have to
weigh the pros and cons of buying a new OS or an old one :-)
If you're buying a new Mac, and you want it to ship with IE5.5 - don't wait
too long. A little birdie told me that Leopard (Mac OS X 10.5) will only
include Safari. There's no IE in sight, at least the birdie didn't see one
on the beta.

Buying a new Mac with the old OS hasn't been an option for several years. If
you need to boot MacOS 9, you'll have to buy one used. Even some PPC Macs,
like G5s and later model G4s, won't boot MacOS directly. Although they do
support running older apps under Mac OS X in Classic, which the Intel based
Macs don't support at all.

To be honest, in my opinion IE/Mac isn't worth even the little bit of effort
we've put into talking about it. It hasn't been updated since it was first
Carbonated four or five years ago, and I don't know of a single Mac user
that still uses it. I suspect that the only reason Apple bothered to keep
shipping it was a contract obligation to do so - it hasn't been the default
browser since Safari was first released.

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
Apr 4 '07 #20

P: n/a
In article <lq***************************@40tude.net>,
Els <el*********@tiscali.nlwrote:
dorayme wrote:
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 ...
I sort of recall you once saying you had owned or used (?) one. I
mentioned it only in case the info I was giving was old hat to
you.
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 is the same as far as I can see, it is just that it runs
natively in X. Unlike retro motor bikes and cars, which are
mostly highly modernised.

--
dorayme
Apr 4 '07 #21

P: n/a
In article <90********************************@4ax.com>,
Dick Gaughan <us****@gaelweb.co.ukwrote:
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.

Either you are making a mistake of great magnitude or are using
"some" in a highly logicalised manner.

--
dorayme
Apr 4 '07 #22

P: n/a
Bergamot <be******@visi.comwrites:
If it takes more than 5 or 10 minutes to beat Mac IE into submission, I
give up on it altogether and let it get just a simplified stylesheet.
It's just not worth the anguish any more.
I don't even bother with the alternate stylesheet. None of the three
people still using IE/Mac have complained yet. :-)

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
Apr 4 '07 #23

P: n/a
Sherm Pendley wrote:
Bergamot <be******@visi.comwrites:
>If it takes more than 5 or 10 minutes to beat Mac IE into submission, I
give up on it altogether and let it get just a simplified stylesheet.

I don't even bother with the alternate stylesheet.
Actually, the simplified stylesheet is my default for all browsers. I
use @import and @media rules for the better equipped browsers.

--
Berg
Apr 4 '07 #24

P: n/a
In <do**********************************@news-vip.optusnet.com.au>
on Thu, 05 Apr 2007 08:07:21 +1000, dorayme
<do************@optusnet.com.auwrote:
>In article <90********************************@4ax.com>,
Dick Gaughan <us****@gaelweb.co.ukwrote:
>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.


Either you are making a mistake of great magnitude or are using
"some" in a highly logicalised manner.
"Some", as in "a number greater than 1 but hopefully less than
infinity".

--
DG
Apr 5 '07 #25

P: n/a
In article <jn********************************@4ax.com>,
Dick Gaughan <us****@gaelweb.co.ukwrote:
In <do**********************************@news-vip.optusnet.com.au>
on Thu, 05 Apr 2007 08:07:21 +1000, dorayme
<do************@optusnet.com.auwrote:
In article <90********************************@4ax.com>,
Dick Gaughan <us****@gaelweb.co.ukwrote:
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.

Either you are making a mistake of great magnitude or are using
"some" in a highly logicalised manner.

"Some", as in "a number greater than 1 but hopefully less than
infinity".
OK, I suspect you are missing this fact from your collection:

Almost no one out there would know the difference between a
compliant browser and a 47 bus.

--
dorayme
Apr 5 '07 #26

P: n/a
In <do**********************************@news-vip.optusnet.com.au>
on Thu, 05 Apr 2007 12:24:19 +1000, dorayme
<do************@optusnet.com.auwrote:
>Almost no one out there would know the difference between a
compliant browser and a 47 bus.
I don't know. Mine's usually quite compliant after you hit it with
a hammer a couple of times.

--
DG
Apr 5 '07 #27

P: n/a
In article <h4********************************@4ax.com>,
Dick Gaughan <us****@gaelweb.co.ukwrote:
In <do**********************************@news-vip.optusnet.com.au>
on Thu, 05 Apr 2007 12:24:19 +1000, dorayme
<do************@optusnet.com.auwrote:
Almost no one out there would know the difference between a
compliant browser and a 47 bus.

I don't know. Mine's usually quite compliant after you hit it with
a hammer a couple of times.
I thought we were talking about the unwashed masses, the prols
out there, the punters, the suckers, the soldiers, the voters,
the ruled, the seething masses, not your browser? <g>

--
dorayme
Apr 5 '07 #28

This discussion thread is closed

Replies have been disabled for this discussion.