Results 1 to 2 of 2

Thread: Centering A Page In CSS

  1. #1
    Join Date
    Jan 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Centering A Page In CSS

    Hi im wishing to have my site centred using css and don't know where im going wrong...

    http://www.future-digital.co.uk/

    Also could i have some help in auto sizing the height of the page because 1080 height leaves a box underneath it.

    Thank you very much,

    Jack Jones
    Last edited by britishchampion; 01-03-2008 at 04:51 PM. Reason: spelling mistake!

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Code:
    selector {
         margin: 0 auto;
         width: 80%;
         min-width: 760px;
    }
    selector - html element you wish to center. for your entire page its generally used on the body element

    80% - the width value is heavily debated about what is the best method. I prefer using a percentage of the user defined available viewport, because it allows for best use for lower and higher screen resolutions


    Also could i have some help in auto sizing the height of the page because 1080 height leaves a box underneath it.
    I am not too sure what you mean by this statement, however by default the hieght of any element is determined by the amount of content contained within the element. This is in regards to quantity of characters, as well as width of the element. If this does not answer your question, could you please provide a more descriptive explanation of what your question and one of us will help you as soon as we get around to it.

Bookmarks

Posting Permissions

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