Click here to get back home

centering a div inside of a div in FireFox

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
centering a div inside of a div in FireFox lkrubner 05-24-2005
Posted by lkrubner on May 24, 2005, 2:02 pm
Please log in for more thread options


I'm struggling to redesign this site so that it is "stretchy".
Previously everything was fixed-width and absolutely positioned. I was
hoping to get the text at top to center inside the top banner. This
works in IE on a PC, but not in FireFox. Any tips?

http://www.publicdomainsoftware.org/index.php?pageId=29


Posted by David Dorward on May 24, 2005, 10:53 pm
Please log in for more thread options


lkrubner@geocities.com wrote:

> I'm struggling to redesign this site so that it is "stretchy".
> Previously everything was fixed-width and absolutely positioned. I was
> hoping to get the text at top to center inside the top banner. This
> works in IE on a PC, but not in FireFox.

http://dorward.me.uk/www/centre/

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is

Posted by Arne on May 24, 2005, 11:48 pm
Please log in for more thread options


Once upon a time *lkrubner@geocities.com* wrote:

> I'm struggling to redesign this site so that it is "stretchy".
> Previously everything was fixed-width and absolutely positioned. I was
> hoping to get the text at top to center inside the top banner. This
> works in IE on a PC, but not in FireFox. Any tips?
>
> http://www.publicdomainsoftware.org/index.php?pageId=29
>

<div> is block level element, text is inline content. Add
"margin-left:auto;" and "margin-right:auto;" to the block level
element and it will center the <div>.

"text-align:center;" centers only the inline content (sutch as text).
IE has bugs that often treats block level as inline for centring.

--
/Arne

Top posters will be ignored. Quote the part you
are replying to, no more and no less! And don't
quote signatures, thank you.

Similar ThreadsPosted
Centering a DIV within a DIV? October 27, 2005, 2:31 pm
CSS issues with IE - not centering div November 14, 2007, 12:04 pm
Centering a Table April 11, 2008, 2:07 pm
centering page April 29, 2008, 1:06 am
Centering Image in
October 2, 2008, 12:41 pm
Centering floating objects September 11, 2004, 10:27 pm
Vertically centering tables September 19, 2005, 5:21 pm
centering web site pages July 13, 2006, 8:00 am
fieldset around form -or- centering within div??? January 31, 2007, 12:39 pm
centering text vertically in div November 9, 2007, 1:39 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap