Solved

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

Posted on 2008-10-07
2
1,344 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…

808 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