PDA

View Full Version : Centering A Page In CSS



britishchampion
01-03-2008, 04:49 PM
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

boogyman
01-03-2008, 08:09 PM
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.