[SOLVED] Body align central

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Locked
alby

[SOLVED] Body align central

Post 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
Last edited by alby on Sun Sep 16, 2007 9:53 pm, edited 1 time in total.
KO
Power Poster
Power Poster
Posts: 562
Joined: Mon Nov 06, 2006 7:55 pm

Re: Body align central

Post by KO »

Does you css have:

page or #page  ?

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

Br, K
alby

Re: Body align central

Post 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
Last edited by alby on Sun Sep 16, 2007 7:56 pm, edited 1 time in total.
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: Body align central

Post 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.
alby

Re: Body align central

Post 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
Locked

Return to “Layout and Design (CSS & HTML)”