How do i centre the page?
Code for a centered div:
The key is "margin: 0 auto;"
<div style="width: 400px; height: 400px; background: #f00; margin: 0 auto;">
Centering anything requires setting a width less than 100% for the container. Example:
margin: 0 auto;
background: #fff url(path to non-tiled image) no-repeat center scroll;
Change parameters as you need. Set "#fff" to background color you want. Set "scroll" to "fixed" if you want page contents to scroll over background image. CSS was given for an image that does not tile.
hey guys, thanks for the responce.
I want to centre the entire page which is not in a div. Can you please give me step by step instructions?
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)