TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

Absolute Center??Possible with CSS??

Page: 1 Reply
Jan 20th 2004#138617 Report
Member since: Dec 4th 2001
Posts: 171
I am trying to have my website in the dead middle of the web page. I was wondering,should I look into CSS on how to do this?? Or someting like javascript?
Reply with Quote Reply
Jan 20th 2004#138635 Report
Member since: Mar 18th 2001
Posts: 6632
Reply with Quote Reply
Jan 21st 2004#138712 Report
Member since: Mar 29th 2003
Posts: 1326
I'm sure all those links tell you how to do it, but its really a lot simpler then a lot of those sites make it out to be (as with a lot of things in CSS IMO). Just go...

[code]
body { text-align: center; } /* for it to work in IE */
#centered_div { margin-left: auto; margin-right: auto; text-align: left; } /*for it to work in other browsers - and to recover from the previous text-align: center */
[/code]

...and it should work in most browsers I think. Thats what I do, anyways. Check out this link, too:

http://dorward.me.uk/www/centre/

Good luck!
Reply with Quote Reply
Jan 21st 2004#138715 Report
Member since: Nov 26th 2001
Posts: 2586
I think the main difference is those other centering div's have been tested on older IE and Netscape browsers.
Reply with Quote Reply
Jan 21st 2004#138717 Report
Member since: Mar 18th 2001
Posts: 6632
He's wanting to center it vertically and horizontally the way I understood it, trhaynes. I could be wrong though.

Many times the reason CSS is more complicated than it should be is just to get it to work with IE though.
Reply with Quote Reply
Jan 21st 2004#138719 Report
Member since: Mar 29th 2003
Posts: 1326
Oh yeah, I was just reading over your question again and I noticed that you said "absolute center" as in vertically, too. My example won't do that. Sorry for misunderstanding your query :D
Reply with Quote Reply
Jan 21st 2004#138822 Report
Member since: Mar 18th 2001
Posts: 6632
Reply with Quote Reply
Jan 22nd 2004#138914 Report
Member since: Dec 4th 2001
Posts: 171
Thanks alot guys!!
Reply with Quote Reply
Page: 1 Back to top
Please login or register above to post in this forum