centering a div inside of a div in FireFox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lkrubner@geocities.com

    centering a div inside of a div in FireFox

    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?



  • Arne

    #2
    Re: centering a div inside of a div in FireFox

    Once upon a time *lkrubner@geoci ties.com* wrote:
    [color=blue]
    > 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
    >[/color]

    <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.

    Comment

    • David Dorward

      #3
      Re: centering a div inside of a div in FireFox

      lkrubner@geocit ies.com wrote:
      [color=blue]
      > 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.[/color]



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

      Comment

      Working...