This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > September 2005 > centering





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author centering
Bill

2005-09-20, 7:40 pm

Hi


Margin: auto doesn't seem to work in IE.

Is there another way to have a <div> smaller than the screen to be centered
for any scr.width ?
Like <table align="center"> does.

Thanks


Els

2005-09-20, 7:40 pm

Bill wrote:

> Margin: auto doesn't seem to work in IE.
>
> Is there another way to have a <div> smaller than the screen to be centered
> for any scr.width ?
> Like <table align="center"> does.


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

The reason your IE doesn't respond to auto:margin, is probably that
you don't have a complete doctype. Means it will be in Quirksmode, (as
opposed to standards mode), just like IE5 naturally is.

The above link shows how to deal with IE5, and that should work for
IE6 in Quirksmode too.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Extreme - Color Me Blind
David Dorward

2005-09-21, 4:38 am

Bill wrote:

> Margin: auto doesn't seem to work in IE.


http://dorward.me.uk/www/centre/#ie

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
sschling@gmail.com

2005-09-21, 7:34 pm

css:
#container {
margin: 0 auto;
width: 760px;
}

html:
<div id="container">
hello
</div>

If you have the correct doctype as Els mentioned, this should work

Bill

2005-09-21, 7:34 pm

Thanks to you all

<doctype > did the work




Jim Moe

2005-09-21, 7:34 pm

Bill wrote:
>
> Margin: auto doesn't seem to work in IE.
>

You must also set a width less than 100%.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews