try using padding for css
or use <center></center> for body, <center> is the most easy way without using css.
Printable View
try using padding for css
or use <center></center> for body, <center> is the most easy way without using css.
Please share a working example. Which works with more then 1 browser.
We are looking for a CSS solution. <center> tag is not supported by XHTML strict. As it is a deprecated tag. CSS should be used to horizontal align text or images. Which can be done with
text-align: center;
margin: 0px auto; (where of course 0px can be a other measure or value)
float : left
then padding w/e cords.
Maybe we could grab the users screen resolution with PHP?
But...doesn't that have a tendancy to be really inaccurate?
I think that goes a bit far to use server-sided code to determine the screen size. JavaScript can do this as well assuming even that PHP or ASP can do such things.
Then of course it isn't the screen size that matters but the window size, just imagine someone has 3 bars with toolbars or whatever... his screen resolution might be the same as mine but the center of the window is not.
Wow, you sure are going out of your way to adhere to a "standard" that is clearly going against your will... I would've just did what worked, tested to see it displayed correctly in a few browsers, and that'd be the end of it.
Let me rephrase this: Those standards are theoretical ideals. Conforming to them is great, but if there is an easier solution, then use it. "If the shoe fits, wear it."
I'm surprised noone posted this yet:
http://www.student.oulu.fi/~laurirai/www/css/middle/
...and let that be the end of this thread -.-
I am very glad you're not a webdesigner I have to work with.. Standards are the only way to make sure your page not only looks good now but will also look good in the future. If more people thought like you we'd still be using tables as design elements and crap like that :icon6:
Rule of thumb to adhere to: if you need hacks to get it to work, don't use it. There are ways to vertically allign correctly, whose limitations are there for a good reason.