|
|
|
|
![]() ![]() |
Jun 30 2008, 08:57 AM
Post
#1
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 53 Joined: 12-June 08 From: Netherlands Member No.: 63,541 |
Many people would like theire website in the center of the screen.
This is how to do that. 1. make a new css document. 2. Then place the following code in it. CODE #main-div { position: absolute; top: 50%; left: 50%; width: 70em; height: 50em; margin-top: -25em; /*always take 1/2 from the size of the height, they have to be negative*/; margin-left: -35em; /*always take 1/2 from the size of the width, they have to be negative*/ } Then place in your html: the following code. CODE <div id="main-div"> content </div> This wil place the div box in the center of the screen, works mostly for any resolution depends on the size of your div box. Hope this helped some people. |
|
|
|
![]() ![]() |
Similar Topics
| Topics | Topics | |
|---|---|---|
|
|
|
|
Lo-Fi Version | Time is now: 7th October 2008 - 01:44 AM |