PDA

View Full Version : Center all content in browser window



starlameris
07-21-2005, 04:38 PM
Is there a way to center ALL content of an html document (both vertically and horizontally) using css? I don't want to use absolute positioning because I want it to be centered regardless of screen/window size. I know how to do this with tables, but I'm trying to break away from that and force myself to use css whenever possible...

jcschott
07-21-2005, 07:57 PM
Instead of using absolute positioning try using float:

here is a sample of the code

.pullquote { float: center;}

mwinter
07-21-2005, 08:10 PM
Instead of using absolute positioning try using float:

here is a sample of the code

.pullquote { float: center;}There is no center value for the float property. You either float left, right or not at all (none).



Is there a way to center ALL content of an html document (both vertically and horizontally) using css?There are various methods for centring, but poor CSS support in certain browsers make centring (vertically, especially) difficult. This has been discussed before (http://www.dynamicdrive.com/forums/showpost.php?p=11400&postcount=3).

Good luck,
Mike

starlameris
07-21-2005, 09:48 PM
There are various methods for centring, poor CSS support in certain browsers make centring (vertically, especially) difficult. This has been discussed before (http://www.dynamicdrive.com/forums/showpost.php?p=11400&postcount=3).

Good luck,
Mike[/QUOTE]


Thanks for directing me. When I searched the forum I got nothing. :)