|
| |
|
|
dsulvett
Posts: 92 Joined: 7/8/2004 Status: offline
|
Centering the page on the monitor - ANY monitor - 5/8/2008 14:35:43
Hello All; I was wondering if someone could tell me how to have a page ALWAYS center in any web browsers (or the more popular ones) Now, i was wondering if there was just some kind of java script line i could put into the code, or something small. For the amount of web stuff i do, i really dont want to learn CSS... im looking for a quick fix to this... Thanks Dave Here is a sample www.152harrellave.com notice how it is off center!! thanks again
|
|
|
|
BobbyDouglas
Posts: 5432 Joined: 5/15/2003 From: Arizona Status: offline
|
RE: Centering the page on the monitor - ANY monitor - 5/8/2008 15:39:29
You will want to remove the javascript that resizes the window when testing this.. In your HTML code, right after the <body> tag, add: <div align="center"> and then right before the </body> tag, add </div>
_____________________________
Arizona Web Design - Mr Bobs Web Design in Arizona The Arizona Web Hosting Challenge
|
|
|
|
dsulvett
Posts: 92 Joined: 7/8/2004 Status: offline
|
RE: Centering the page on the monitor - ANY monitor - 5/9/2008 17:00:55
Hi Bobby- Thank you but either im doing this wrong or ???? when i do what you said, everything goes whacked! hmmm..can you show me an example please... Thanks Dave
|
|
|
|
Tailslide
Posts: 5915 Joined: 5/10/2005 From: Out here on the raggedy edge Status: offline
|
RE: Centering the page on the monitor - ANY monitor - 5/10/2008 2:46:54
You've got everything positioned absolutely which will lead to major problems. You've also got a 225px left and right margin on the body element and other elements. Try removing that for a start. You could try one of two methods. 1. Give the body element a width (820px?) and then add margin:0 auto; Also remove the 225px margin on the inner divs. 2. If that doesn't do the trick then as Bobby says - stick a div around all the content (apart from the menu which says it has to be first) and then give that a width plus margin:0 auto plus position:relative (very important that). The page seems to be forcing the window size which is a bad idea (not polite to say the least). To be honest you should think about removing the absolute positioning rules as they break the page under any other conditions than those you've specified.
_____________________________
"My strategy is so simple an idiot could have devised it" Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|