Subject: [css-d] How to center an image using CSS

From: info at brighton-freelance-web-design.co.uk (Brighton Freelance Web Design)
Date: Sat, 26 Apr 2003 20:21:56 +0100

Hi there,

I'm trying to center the image at the top of this page.

http://www.brighton-freelance-web-design.co.uk/szoo/template.htm

using the following code.

.logo {
	width: 333px;
	margin-right: auto;
	margin-left: auto;
	margin-bottom: 55px;
	text-align: center;
}

It works on IE5.5 Mac but not on IE6 Win.

Any ideas how I can get it to center on the most common browsers?

Andy

---

From: steve at mrclay.org (Steve Clay)
Date: Sat, 26 Apr 2003 15:48:17 -0400

Saturday, April 26, 2003, 3:21:56 PM, Brighton wrote:
BFWD> I'm trying to center the image at the top of this page.
BFWD> http://www.brighton-freelance-web-design.co.uk/szoo/template.htm

Drop the width and l/r margins on .logo.  It will expand to 100%
naturally and text-align will do its job.  You can also use IDs for
elements that only appear once in a document..

<div id="logo">
   <img src="images/logos/home_logo.jpg" width="333" height="96" />
</div>

#logo {
    margin-bottom: 55px;
    text-align: center;
}

Steve
-- 
http://mrclay.org/