Solved

How to center content (body, div, td, etc) for FF3 & IE7?

Posted on 2008-10-07
2
1,345 Views
Last Modified: 2009-05-26
I've been searching for a while today and cannot seem to find the right answer. I am trying to center some elements (body, div, td, etc) for FF3 and IE7.

The doc type I am using is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

The CSS version is 2.1

The CSS works fine in IE7 and mostly works in FF3, except for the centering.

I have tried "margin: auto;", "margin: 0 auto;", "margin-left: auto;", "margin-right: auto;" in addition to "text-align: center;" and I also tried setting the div width to 100% along with these attempts.

I tried on the elements themselves as well as the parent elements.

So... now what? Also, if anyone has a link to a read-able and manageable reference to CSS in FF, that would be great.

Thanks.
0
Comment
Question by:xizwyck
2 Comments
 
LVL 3

Author Comment

by:xizwyck
ID: 22661041
This is frustrating. No matter what I do, I can't get FireFox to center anything - isn't this SUPPOSE to be a better browser?
0
 
LVL 14

Accepted Solution

by:
EMB01 earned 100 total points
ID: 22662046
This is how I center mine:
body { text-align: center; }
div#container {margin: 0 auto; }

Now, just put your content inside the container .DIV. That worked for me on my last cross-browser test...
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question