Welcome to Discuss Everything Forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.


 

Tags for this Thread

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Ash S
    Ash S's Avatar
    Guest

    How can I position my HTML page to appear in the centre no matter how big the monitor...

    ...or the page is ? ? I have an external CSS, design for my page, but i cant get my top bar, bottom bar, left nav and right nav to appear in the middle of the page unless i give them an absolute postion with pixels? here is what it is ... can u help please i know it has to be relative but i dont exacly know how to get it working ...

    * Around the page style */

    #topbar
    {
    background-image:url("imgs/Banner2.jpg");
    position: absolute;
    top: 0px;
    left: 0px;
    width: 754px;
    height: 100px;
    }


    #bottombar
    {*
    background: #ffffcc;
    position: absolute;
    top: 500px;
    left: 0px;
    width: 754px
    height: 60px
    }

    #leftNav
    {*
    background: #ffffcc;
    position: absolute;
    top: 100px;
    left: 0px;
    width: 150px;
    height: 500px;
    }


    #content
    {*
    background: #ffffff;
    position: absolute;
    top: 100px;
    left: 150px;*
    width: 500px;*
    height: 500px;
    }

  2. #2
    planetmatt
    planetmatt's Avatar
    Guest
    Take out the position:absolute and top and left properties and then add:

    margin-left: auto;
    margin-right: auto;

  3. #3
    rickthorneismyhero
    rickthorneismyhero's Avatar
    Guest
    After the body tag put <div id="page"> and close it before </body>, then add div#page {margin: 0 auto;} to your css. Simple.

  4. #4
    louis r
    louis r's Avatar
    Guest
    i find the simplest way to wack everything in the center of the page is by using a master div called #container

    basically u have all your other divs inside this div and center the container div by doing the following : An example

    <html>
    <body
    <--- Begin Container -->
    <div id ="container>
    <div id ="header"> </div>
    <div id ="footer"> </div>

    <--- End Container --->
    </div>
    </body>
    </html>

    the css for the container :

    #container{
    width:708px;
    margin-left:auto;
    margin-right:auto;
    }

    obviously the width of the container is determined by the width of ur layout.

 

 

Quick Reply Quick Reply

Click here to log in


What comes after M0nday

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 10-25-2010, 03:21 AM
  2. Replies: 0
    Last Post: 08-19-2009, 02:03 AM
  3. How to position image on the HTML page ?
    By wildhorse i in forum Ælternate Reality - The PhotoChop Shop
    Replies: 0
    Last Post: 07-08-2009, 10:02 PM
  4. Replies: 1
    Last Post: 06-04-2009, 10:05 PM
  5. Replies: 0
    Last Post: 03-24-2009, 03:15 PM

Bookmarks

Posting Permissions

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