How do I get my website to center in all web browsers and in all resolutions?
Life is Beautiful
2008-04-03 10:31:34 UTC
I am using Frontpage 2003.
I want my site to adjust to whatever the viewers resolution and browser (screen size).
Seven answers:
2008-04-03 10:42:49 UTC
daa has it right! A div container is the way to go. The
tag is deprecated and is not to be used. People who still use this tag are either newbies are people who have no idea how to properly code to meet HTML 4.01 Standards.
Deprecated tags are used with the Transitional DOCTYPE only and that does means transitional...that you plan to update your pages to Strict or higher. New web standards are expected out soon: HTML 5.0 along with CSS3. It may be some time before browser developers catch up, but code your pages properly and you'll be ready with less work.
For some older browsers that don't recognize auto, add:
text-align: center;
Although this says text-align, the style attribute will align a lot more than just text if used correctly. When you have to use it, you may want to add a content/text div container after the page container to reset text-alignment to left if that is what you want other than centered. It's always a good idea to set an inner container for contents anyway.
Ron
2016-10-21 14:46:40 UTC
you want a wrapper counting on the code your divs commence with a div noted as each thing yet its on in easy terms the right 0.5 of your layout. upon getting a wrapper set margins left proper automobile and also you're going to be good to bypass.
web2sign
2008-04-03 10:44:11 UTC
Michael J is right use
any tag name here contents text etc
better to use
or
text-align:center seems have a bug in aligning to center the table viewing in FF
ROY L
2008-04-03 11:06:01 UTC
Put everything in a table 800 pixels wide:
daa
2008-04-03 10:36:39 UTC
Add a wrapper div:
/* Your page content */
Now in your stylesheet, give it a percent width and auto left and right margins:
#wrapper {
width: 80%;
margin: 0 auto;
}
Michael J
2008-04-03 10:36:44 UTC
Put it between
tags.
jerz o
2008-04-03 10:52:07 UTC
I will go with daa's suggestion. Its a good one if u want liquid layout type of design.
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.