phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

Reduce width and center the page -- any simple way?

All style (template, theme and imageset) related questions for the new release; advice, feedback here please.

Re: Reduce width and center the page -- any simple way?

Postby Klors » Mon Jan 08, 2007 1:35 am

If you're literally inserting
Code: Select all
<div id="whatever">
after < body class...> etc. You should just need.
Code: Select all
#whatever {
width: 770px;
margin-left: auto;
margin-right: auto;
}
Klors
Registered User
 
Posts: 95
Joined: Fri Sep 19, 2003 2:08 pm

Re: Reduce width and center the page -- any simple way?

Postby lodp » Mon Jan 08, 2007 2:22 am

that did it! many many thanks!

so, just for the record (and anyone who reads this in a future forum search), i finally inserted

Code: Select all
<div id="whatever">

after <body class="{S_CONTENT_DIRECTION}"> in /template/overall_header.html, and added

Code: Select all
#whatever {
width: 770px;
margin-left: auto;
margin-right: auto;
}

to /theme/stylesheet.css
lodp
Registered User
 
Posts: 26
Joined: Thu Oct 05, 2006 8:42 pm

Re: Reduce width and center the page -- any simple way?

Postby mjd76384 » Mon Jan 08, 2007 3:00 am

Here is what I did.

Edit stylesheet.css:

Add width: 770px; to #wrapheader, #wrapcentre, and #wrapfooter.

Edit overall_header.html:

Add <div align="center"> after <a name="top"></a> and before <div id="wrapheader">.

Edit overall_footer.html:

Add </div> after </div> and before </body>.

This is what I got. Looks right in FireFox 2.
My wife is married to a rock star!
mjd76384
Registered User
 
Posts: 6
Joined: Sun Jan 07, 2007 5:31 pm

Re: Reduce width and center the page -- any simple way?

Postby Cap'n Refsmmat » Mon Jan 08, 2007 3:32 am

Why do you even want fixed-width forums? I'm on a 1400x1050 screen, and they look ridiculous on it.

If you want nice white margins, use a percentage width so you don't irritate people with widescreens.
Cap'n Refsmmat
Registered User
 
Posts: 219
Joined: Tue Jan 25, 2005 11:31 pm

Re: Reduce width and center the page -- any simple way?

Postby lodp » Mon Jan 08, 2007 4:33 am

hadn't thought of that, actually. but how about the lo-res folks -- if you've got the page at 60% width or something, it's a pain in the behind on an 800x600 screen, right?
lodp
Registered User
 
Posts: 26
Joined: Thu Oct 05, 2006 8:42 pm

Re: Reduce width and center the page -- any simple way?

Postby Highway of Life » Mon Jan 08, 2007 5:09 pm

I'm with Cap'n there too...

I have a 1440x900 screen, and it looks pretty awful.
Image
User avatar
Highway of Life
Registered User
 
Posts: 1399
Joined: Tue Feb 08, 2005 10:18 pm
Location: I'd love to change the World, but they won't give me the Source Code

Re: Reduce width and center the page -- any simple way?

Postby Klors » Mon Jan 08, 2007 5:27 pm

lodp wrote:that did it! many many thanks!

so, just for the record (and anyone who reads this in a future forum search), i finally inserted

Code: Select all
<div id="whatever">

after <body class="{S_CONTENT_DIRECTION}"> in /template/overall_header.html, and added

Code: Select all
#whatever {
width: 770px;
margin-left: auto;
margin-right: auto;
}

to /theme/stylesheet.css

You could maybe change it to
Code: Select all
#whatever {
width: 80%;
min-width: 770px;
margin-left: auto;
margin-right: auto;
}

I really can't be bothered going through my testing procedures for the different browsers right now though, don't think I've done any min/max-width testing on IE7 Smile
Klors
Registered User
 
Posts: 95
Joined: Fri Sep 19, 2003 2:08 pm

Re: Reduce width and center the page -- any simple way?

Postby Daworm » Tue Jan 09, 2007 2:52 am

Maybe... set a min-width as pixels, and a max width as percentage ??
Daworm
Registered User
 
Posts: 10
Joined: Mon Jan 08, 2007 4:51 am

Re: Reduce width and center the page -- any simple way?

Postby Nicholas the Italian » Tue Jan 09, 2007 3:02 pm

Daworm wrote:Maybe... set a min-width as pixels, and a max width as percentage ??

This shouldn't work. Instead, you may try min-width: 80%; min-width: 770px. Theoretically, the largest of the two should apply. Does it work? Wink
User avatar
Nicholas the Italian
Registered User
 
Posts: 659
Joined: Mon Nov 20, 2006 11:19 pm
Location: 46°8' N, 12°13' E

Re: Reduce width and center the page -- any simple way?

Postby Klors » Tue Jan 09, 2007 4:07 pm

Code: Select all
#whatever {
width: 80%;
min-width: 770px;
margin-left: auto;
margin-right: auto;
}

I've just tested this and it does work in IE7 (pretty sure it won't in IE6 though, can't test here). When the browser window width is smaller than around 1000px width the forum width doesn't drop below 770px, when it's larger the forum expands out to be 80% of the width.

Of course, that might not be the exact behaviour you're after.
Klors
Registered User
 
Posts: 95
Joined: Fri Sep 19, 2003 2:08 pm

Previous Next

Return to [3.0/Olympus] Styling

Who is online

Users browsing this forum: Exabot [Bot] and 8 guests