1 (edited by freddykgb 2006-02-28 05:06)

Topic: Centering all the forum content [THREAD SOLVED]

I would like to put all the forum content into a 766px invisible box, centered into the web page (auto-margin left and right so resizing the window won't change the centered position), to match my own web site header.  Which is already always centered!

Where and how should I add the code?
Thanks is advance for your help!

By the way, I did this to my web site by adding this code into my CSS and putting all the content in the #conteneur div :

#conteneur
{width: 766px; margin-left: auto; margin-right: auto;}
--



THIS ISSUE HAVE BEEN SOLVED BY ELZAR (MAYBE THIS COULD BE ADDED TO THE PUNBB FAQ)
Here is the proper solution, as Elzar suggested :
--
You need to open the stylesheet (Oxygen.css) etc and replace:

HTML, BODY {MARGIN: 0; PADDING: 0}
#punwrap {margin:12px 20px}
with:

HTML, BODY {MARGIN: 0; PADDING: 0; TEXT-ALIGN: center}
#punwrap {MARGIN: 0 auto; WIDTH: 766px; TEXT-ALIGN: left}

--

A new poker community is rising : see for yourselft at unbluffed.com

2 (edited by Bradyn 2006-02-27 07:01)

Re: Centering all the forum content [THREAD SOLVED]

Check the includes/templates directory.

Also, when centering...

body {text-align: center;}
#wrapper {text-align: left; margin: 0px auto; width: 600px;}

That way it'll work in IE too.

Through the awful grace of God

"Dude, CSS and XHTML are like two boys who are deeply in love.  They're perfect for each other, but no one can acccept it."

Re: Centering all the forum content [THREAD SOLVED]

Bradyn wrote:

Check the includes/templates directory.

Which files ..  and which part do I edit ?


Bradyn wrote:

Also, when centering...

body {text-align: center;}
#wrapper {text-align: left; margin: 0px auto; width: 600px;}

That way it'll work in IE too.

What exactly is for IE?  the 'margin: 0px' part ?


By the way, great signature!

A new poker community is rising : see for yourselft at unbluffed.com

4 (edited by hnstmn 2006-02-27 12:45)

Re: Centering all the forum content [THREAD SOLVED]

Bradyn wrote:

Check the includes/templates directory.

Also, when centering...

body {text-align: center;}
#wrapper {text-align: left; margin: 0px auto; width: 600px;}

That way it'll work in IE too.

Hi, is this the way I would correctly write it into the body tag?

<body {text-align: center;} #wrapper {text-align: left; margin: 0px auto; width: 600px;}>

Then just replace my body tag with this new one as it is layed out above??

thxs...

5

Re: Centering all the forum content [THREAD SOLVED]

No, you need to open the stylesheet (Oxygen.css) etc and replace:

HTML, BODY {MARGIN: 0; PADDING: 0}
#punwrap {margin:12px 20px}

with:

HTML, BODY {MARGIN: 0; PADDING: 0; TEXT-ALIGN: center}
#punwrap {MARGIN: 0 auto; WIDTH: 766px; TEXT-ALIGN: left}

Re: Centering all the forum content [THREAD SOLVED]

Thanks Elzar for pointing the way!! I'll just do as per your instructions!

Thanks & Cheers! smile

7 (edited by freddykgb 2006-02-28 03:23)

Re: Centering all the forum content [THREAD SOLVED]

Yeah thanks very much again Elzar!!  It did the job great on my forum big_smile

But can you explain me why do I have to make a TEXT-ALIGN: center and TEXT-ALIGN: left in addition the the auto margin and width ?

A new poker community is rising : see for yourselft at unbluffed.com

Re: Centering all the forum content [THREAD SOLVED]

IE has a bug which doesn't recognise the margin: auto.  When we go margin: 0px auto, we're saying the top and bottom has a margin of 0px, while the left and right have an auto margin.  We can also do margin: 10px auto 0px auto, for top, right, bottom and left, respectively.

Thankfully, IE has another bug, which was can use to center the div.  The body text-align will centre the entire div, which must have a set width, then the text-align within the div will make sure text inside hte div isn't centre.  Confusing yeah, but trust me, it works!

Through the awful grace of God

"Dude, CSS and XHTML are like two boys who are deeply in love.  They're perfect for each other, but no one can acccept it."

Re: Centering all the forum content [THREAD SOLVED]

Wow, I didn't no that. Thanks for sharing the info!

Cheers!

10 (edited by freddykgb 2006-02-28 18:37)

Re: Centering all the forum content [THREAD SOLVED]

THanks again Bradyn.  Another proof that IE is cr... big_smile

A new poker community is rising : see for yourselft at unbluffed.com