Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: Centre the page

  1. #1
    New Coder
    Join Date
    Apr 2009
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Centre the page

    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

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,853
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    How are you planning to place a 1524px wide image inside a 900px wide body?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello GBizzle99,
    Try making the CSS for body look more like this -
    Code:
    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/fo...ges/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 -
    Code:
    div#navmenu a:link, div#navmenu a:active, div#navmenu a:visited {
    	color: #fff;
    	text-decoration: none;
    }
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #4
    New Coder
    Join Date
    Apr 2009
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Excavator View Post
    Hello GBizzle99,
    Try making the CSS for body look more like this -
    Code:
    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/fo...ges/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 -
    Code:
    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?

  • #5
    New Coder
    Join Date
    Apr 2009
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by abduraooft View Post
    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.

  • #6
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Quote Originally Posted by GBizzle99 View Post
    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 -
    Code:
    <body class="ltr">
    <a name="wrapheader"></a>
    <a name="top"></a>
     
    <div id="wrap" style="width:98%;text-align:left">
    	<div id="header">
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •