Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-13-2011, 12:18 PM   #1
MetaMan
I AM WEB 2.0
 
Industry Role:
Join Date: Jan 2003
Posts: 28,682
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.
MetaMan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-13-2011, 12:23 PM   #2
Deej
I make pixels work
 
Deej's Avatar
 
Industry Role:
Join Date: Jun 2005
Location: I live here...
Posts: 24,386
i do well with margin auto... and usually a fix with IE...

is that giving you issues across browsers?
__________________

Deej's Designs n' What Not
Hit me up for Design, CSS & Photo Retouching


Icq#30096880
Deej is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-13-2011, 12:23 PM   #3
Deej
I make pixels work
 
Deej's Avatar
 
Industry Role:
Join Date: Jun 2005
Location: I live here...
Posts: 24,386
oh wait you mean like center hieght and width dont you...

depending on browser res and everything?
__________________

Deej's Designs n' What Not
Hit me up for Design, CSS & Photo Retouching


Icq#30096880
Deej is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-13-2011, 12:26 PM   #4
MetaMan
I AM WEB 2.0
 
Industry Role:
Join Date: Jan 2003
Posts: 28,682
Quote:
Originally Posted by Deej View Post
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
MetaMan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-13-2011, 12:29 PM   #5
Deej
I make pixels work
 
Deej's Avatar
 
Industry Role:
Join Date: Jun 2005
Location: I live here...
Posts: 24,386
Nice
__________________

Deej's Designs n' What Not
Hit me up for Design, CSS & Photo Retouching


Icq#30096880
Deej is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-13-2011, 02:08 PM   #6
Ron Bennett
Confirmed User
 
Join Date: Oct 2003
Posts: 1,653
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
__________________
Domagon - Website Management and Domain Name Sales
Ron Bennett is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-13-2011, 02:28 PM   #7
MetaMan
I AM WEB 2.0
 
Industry Role:
Join Date: Jan 2003
Posts: 28,682
Quote:
Originally Posted by Ron Bennett View Post
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.
MetaMan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-13-2011, 02:51 PM   #8
Ron Bennett
Confirmed User
 
Join Date: Oct 2003
Posts: 1,653
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
__________________
Domagon - Website Management and Domain Name Sales
Ron Bennett is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.