View Full Version : xhtml page in center
11th May 06, 08:43 PM
I slicing a xhtml page with table and want this page center both horizontal and vertical position in high regulation(1280 x 1024). How can I fix it?
11th May 06, 09:00 PM
If you use som of this and some of that
Centering with negative margins (http://bluerobot.com/web/css/center2.html) basic centered (http://www.thenoodleincident.com/tutorials/box_lesson/basic_centered.html)
After spending some time with google I found this
The really centered box (http://lixlpixel.org/centered_box/)
21st May 06, 04:25 PM
I don't know of any clean way to do it, but here is a dirty one which should work :P Only way I chould think of....
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
margin: 0 auto;
<table id="wrap" cellpadding="0" cellspacing="0" border="0">
<div id="center_me">Center me!</div>
21st May 06, 11:34 PM
sido, why table and mixed alignments when you could do it much easier with divs and smother css?
23rd May 06, 03:31 PM
I was just brainstorming a bit, since I haven't seen a good way to do it without tables.
Putting al the alignments in CSS also works
23rd May 06, 08:58 PM
Since it might have been over looked you shouldn't be using tables for layout. Tables should only be used for tabular data.
If you need help centering with div's and proper layout HTML markup there quite a few threads on this board with explanations and example code. :)
25th May 06, 09:55 AM
Yes, I known it's dirty to use a table for this, but at the end of the day it about whatís gets the job done. Since I havenít really seen a way to vertically center something on a page (usually I just avoid it) and drop any content in it, I posted this.
Most of the trick I seen, come with some calculation and can break if the wrong content is drop in to it. But if you any better tricks, please let me know where to find them.
25th May 06, 07:09 PM
Ok, still playing around a bit and though of a nicer way to vertical align content on your page. This one comes close to what I want, but you still have to do some calculations to get it right there in the middle of the screen...
I've tested it in FF1.5, IE6 and Opera 8.5
Try this one:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
margin: -50% 0 0 -50%;
<a href="http://blueballfixed.ytmnd.com/">Blue Ball Machine</a><br />
25th May 06, 07:34 PM
vBulletin® v3.8.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.