I have a special problem:
My main page is a div and I would like it to always stay centered. I also do not want to use the "onload()" event to handle this. If i use <center> then everything inside the div is positioned relative to the screen and not the div (absolute).
can you post the code or give us a link?
All you need to do is wrap your content div in a div and then center the wrapper div.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
margin: 0px auto 0px auto;
padding: 0px 0px 0px 0px;
border: 1px solid red}
<h1>Page contents go in this div</h1>
thanks everyone! I also found another way though. give the div left:50%; and then
margin-left:minus half the width.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)