GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   What is the best way to vertical align center of a window? (https://gfy.com/showthread.php?t=1010168)

MetaMan 02-13-2011 12:18 PM

What is the best way to vertical align center of a window?
 
I have a block and want it to float in the middle of a window. Any tips on how to do this?

Ive done some searches but cant seem to put my finger on it.

Deej 02-13-2011 12:23 PM

i do well with margin auto... and usually a fix with IE...

is that giving you issues across browsers?

Deej 02-13-2011 12:23 PM

oh wait you mean like center hieght and width dont you...

depending on browser res and everything?

MetaMan 02-13-2011 12:26 PM

Quote:

Originally Posted by Deej (Post 17912714)
oh wait you mean like center hieght and width dont you...

depending on browser res and everything?

just center height then i put a wrapper around it for width:

http://blog.themeforest.net/tutorial...ring-with-css/

the 2nd example here ended up working for me actually. weird couldnt find it all day yesterday then 15min today works hehe.

thanks i know you were gonna give it a shot, maybe it will help you in the future :)

Deej 02-13-2011 12:29 PM

Nice :thumbsup

Ron Bennett 02-13-2011 02:08 PM

Or do it old school style with tables. Quick, easy, and predictable. And works in all major browsers dating back to the late-1990s.

CSS is fine most of the time, but tables are still useful in some situations.

Ron

MetaMan 02-13-2011 02:28 PM

Quote:

Originally Posted by Ron Bennett (Post 17912821)
Or do it old school style with tables. Quick, easy, and predictable. And works in all major browsers dating back to the late-1990s.

CSS is fine most of the time, but tables are still useful in some situations.

Ron

i wasnt even able to float a table center height of a browser window.

center of browser height, not center of table height.

Ron Bennett 02-13-2011 02:51 PM

Oh, vertically align within the entire browser window ... ok, that is more challenging even with tables.

However, it can be done and still looks to be much simpler and more predictable than using CSS alone - see the following link for details ... http://apptools.com/examples/tableheight.php

Tables and CSS together is likely your best bet for compatibility with recent browsers.

Or if in a rush and "quirks mode" is good enough (it may be if your site already is already being rendered that way by default; many sites still are), then just add in the table attributes height="100%" - but as the above link points out, that's not recommended, because the height attribute, according to the article and based on my own experience, has never been part of any W3 html standard.

Ron


All times are GMT -7. The time now is 01:52 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123