|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Website Centering
I need to center my whole website so it is centered on any res.... i have tryed but have failed!! Everything is in tables, so if that is a help...
www.senseof16.tk |
|
#2
|
||||
|
||||
|
It looks centered to me. Have you tried using <div align="center"></div> just inside your body tags?
|
|
#3
|
|||
|
|||
|
CSS is your answer
I'm assuming your content has a certain fixed width ? at least and possibly fixed height as well? basically you can easily do this in css with one div layer. lets say your fixed width is 600 px wide... and your height was 400px... Code:
#midfloat { position: absolute;
top:50%; left:50%;
margin-top:-200px;
margin-left:-300px;
border:0px;
}
Now just put the <div id="midfloat"> your content </div> What thats doing is telling the top left corner of that div tag and the stuff in it to start at 50% from top and left (or the center). Then your subtracting half your height and half your width to move that top left corner or your div so that now the center of that fixed width 'box' is at dead center. Then resize away - works great. |
![]() |
| Viewing: Dev Shed Forums > Web Site Management > Scripts > Website Centering |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|