Page 1 of 1

[SOLVED] Body align central

Posted: Sun Sep 16, 2007 3:12 pm
by alby
I have a open template (from OSWD).
This template is XHTML 1.0 Transitional and I want XHTML 1.0 Strict.

I changed all tags for this but I have a problem of central body in FF, in IE 6 is good  :-\

In originale template there is:

Code: Select all

...........
</__body>
	<div id="page" align="center">
		<div id="header">
..........
I substitute in template:

Code: Select all

..........
</__body>
	<div id="page">
		<div id="header">
..........
and in CSS:

Code: Select all

body{
	text-align:center;
}
#page{
	margin:0 auto;
	text-align:left;
}
Help. Any ideas?  :'(

Thanks
Alby

Re: Body align central

Posted: Sun Sep 16, 2007 6:40 pm
by KO
Does you css have:

page or #page  ?

I'm not sure if that align="center" is needed in template.

Br, K

Re: Body align central

Posted: Sun Sep 16, 2007 7:49 pm
by alby
KO wrote: Does you css have:

page or #page  ?
Yes, my mistake with copy/paste. I have correct my post.

KO wrote: I'm not sure if that align="center" is needed in template.
No, align="center" was in prev template XHTML 1.0 Transitional but in Strict broke validation


EDIT:
Ok, I posted online here
Browser:
FF  left
IE 6 e IE 7 central
Opera 9  left


Alby

Re: Body align central

Posted: Sun Sep 16, 2007 8:03 pm
by tsw
div#page{
margin:0 auto !important;
width:800px;
}

divs are by default width: 100%; so margin: 0 auto cant really do anything.

the 800px is my guess based on your header width.

Re: Body align central

Posted: Sun Sep 16, 2007 9:53 pm
by alby
tsw wrote: div#page{
margin:0 auto !important;
width:800px;
}

divs are by default width: 100%; so margin: 0 auto cant really do anything.

the 800px is my guess based on your header width.
Great  :D
Many many thanks and applaud  :)

Alby