Problem with Centering a website

B

Beauregard T. Shagnasty

jb said:
try:

body,html {margin-left: auto; margin-right: auto}

That doesn't work, as the whole red thing is a background image, and the
margin won't move it. The only text on the page is "John Doe" and the
words that look like they should be links.

Methinks Baby Doe needs to do some reading...
http://htmldog.com/ would be a good place to start.
 
N

Nije Nego

I am having troubling my website. The address is
http://www.showandselldesigns.com/baby
I am trying to center the page in the middle of the page.
Can anyone help?
Brian

As far as I can see - web site is centered!
Background image is not, since it is too small, and it does not fill the
window.
If you want to center backgound image include this into your css body {
background-position: center;

OT:
Me thinks, for a "innovative web design company" you have bigger problems
than this one.
 
W

websiterepairguy

Brian said:
I am having troubling my website. The address is
http://www.showandselldesigns.com/baby
I am trying to center the page in the middle of the page.
Can anyone help?
Brian

Surrounding all your content with a table tag and
setting align=center will work.

I know that align=center is deprecated. I'm sure
others will tell you why.

Ed
 
S

saz

Surrounding all your content with a table tag and
setting align=center will work.

I know that align=center is deprecated. I'm sure
others will tell you why.

Ed
Ed:

I've seen your business site, and you claim to specialize in website
repair...you need to sharpen your skills.

Without discussing the deprecated element, the correct format is:

align="center" (note the quotes)

But that's still the wrong answer. The correct css is:

body {
background-image: url(img00000.jpg);
background-position: center;
background-repeat: no-repeat;
background-color: #999999;
margin-left: 1.79in;
margin-right: 1in;
margin-bottom: 1in;
}

Note that I added the one line - background-position: center;

If desired, continue to modify background-position to achieve the
distance from the top. For example, changing it to:

background-position: center 100px;

would place the background image in the center 100px from the top of the
page.

I would also discourage the use of "in" for text placement. Use
percentages, em or pixels and margin:auto; when possible. Using "in"
will not give the desired effects in different resolutions.

Better yet - use a container div (not a table) to center all the text
within the image. It will give much cleaner code, especially if you
plan on going back in to make updates on a regular basis.
 
Joined
Oct 31, 2008
Messages
4
Reaction score
0
Hi,
Using align tag is not web standards compliant. You should center a site using the following method described here.
acmeous.blogspot.com/2008/05/how-to-center-website-or-any-element.html

It is robust and performs consistently in every browser and also validates.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,998
Messages
2,570,242
Members
46,835
Latest member
lila30

Latest Threads

Top