...

View Full Version : Centre the page



GBizzle99
05-10-2009, 04:11 PM
Can anyone tell me how I would centre this page?

It is using phpBB and I would like it to be in the middle. ALso why the yellow Navigation bar is not showing?

cheers

heres the link:

www.theschoolproject.co.uk/forum

abduraooft
05-10-2009, 04:57 PM
How are you planning to place a 1524px wide image inside a 900px wide body?

Excavator
05-10-2009, 05:03 PM
Hello GBizzle99,
Try making the CSS for body look more like this -

body {
/*width:900px;*/
font:"Courier New", Courier, monospace; /*added ; here*/
color: #FFFFFF;
background: #565656 url(Background3.jpg) center fixed;
text-align: center; /* Makes div#wrap be centralized in MSIE. */
}

When you made body only 900px wide #wrap's 900px min-width just fit so there was nothing to center.

For your menu, there are much better ways to write a menu than putting links in p tags and spacing them out with non breaking spaces. You're welcome to use any of my Menu examples that you like - http://nopeople.com/design/CSS%20tips/index.html

It's not showing because you have black text and http://www.theschoolproject.co.uk/forum/images/NavBar.jpg is not available.
The menu would show if you either correct the path to NavBar.jpg or make the link text a different color -

div#navmenu a:link, div#navmenu a:active, div#navmenu a:visited {
color: #fff;
text-decoration: none;
}

GBizzle99
05-10-2009, 05:45 PM
Hello GBizzle99,
Try making the CSS for body look more like this -

body {
/*width:900px;*/
font:"Courier New", Courier, monospace; /*added ; here*/
color: #FFFFFF;
background: #565656 url(Background3.jpg) center fixed;
text-align: center; /* Makes div#wrap be centralized in MSIE. */
}

When you made body only 900px wide #wrap's 900px min-width just fit so there was nothing to center.

For your menu, there are much better ways to write a menu than putting links in p tags and spacing them out with non breaking spaces. You're welcome to use any of my Menu examples that you like - http://nopeople.com/design/CSS%20tips/index.html

It's not showing because you have black text and http://www.theschoolproject.co.uk/forum/images/NavBar.jpg is not available.
The menu would show if you either correct the path to NavBar.jpg or make the link text a different color -

div#navmenu a:link, div#navmenu a:active, div#navmenu a:visited {
color: #fff;
text-decoration: none;
}


Ok so it has centred the content, but it has stretched it across the whole page. I would like it 900px wide but in the middle of the page and to be fixed, not fluid?

GBizzle99
05-10-2009, 05:47 PM
How are you planning to place a 1524px wide image inside a 900px wide body?

I am going to change the resolution of the image, but I can do that easily in photoshop. Not my main worry.

Excavator
05-10-2009, 07:14 PM
Ok so it has centred the content, but it has stretched it across the whole page. I would like it 900px wide but in the middle of the page and to be fixed, not fluid?

Well, you still have width: 98%; and min-width: 900px; on #wrap. That would stretch it accross the whole page until it gets wider than 900px.
If you want it to be 900px wide then set #wrap to width: 900px;
Get rid of the inline styling -

<body class="ltr">
<a name="wrapheader"></a>
<a name="top"></a>

<div id="wrap" style="width:98%;text-align:left">
<div id="header">



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum