Center Page in all 'Platforms'
I am looking to see if there is any way i can center my page in all platforms(wrong word sorry, but i can't think of how to say it)? (IE, Mozilla...ect.) anyone know how?
tables or css?
using css you need margin: auto; on the element to be centered and text-align: center as the work around for IE.
I mainly use tables. Considering im fairly new to this and that is the easiest thing.
obviously CSS is better than tables, but try using
<table style="margin: auto; text-align: left;">
(as in, add the style section into your table tag)
Then put a div around the entire page with text-align: center;
<div style="text-align: center;">
your table and page contents
On the other hand, if you aren't concerned at all about accessibility and just posted in the wrong forum, nest a table round the lot and centrally align the table inside it. Nested tables are a bad idea though...
IE5 is a problem here though. You'll need to specify "text-align: center;" to the BODY. On the containing DIV, set "margin-left:auto;margin-right:auto;" to get the widest possible consistency as some browsers don't get shorthand CSS.
The code I provided works perfectly in IE4 upwards.
Aye it does, although BODY is also a container that should be appropriately styled according to the contents and their positioning requirements.
Originally Posted by DaveSW
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)