Centering All Content

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • SamMan

    Centering All Content

    A few months ago, I recalled reading somewhere the way to center content in
    Mozilla-based browsers was like this...

    body {
    margin: 0px auto;
    text-align: center; /*for IE*/
    }

    My memory recalls this working, but now upon revisiting, it is not. What is
    the proper way to center content?

    Thanks.

    --
    SamMan
    Rip it to reply



  • Stan Brown

    #2
    Re: Centering All Content

    On Tue, 14 Jun 2005 00:39:14 GMT, "SamMan" <sam@psfdevri p-it.com>
    wrote:
    [color=blue]
    >A few months ago, I recalled reading somewhere the way to center content in
    >Mozilla-based browsers was like this...
    >
    >body {
    > margin: 0px auto;
    > text-align: center; /*for IE*/
    >}
    >
    >My memory recalls this working, but now upon revisiting, it is not. What is
    >the proper way to center content?[/color]

    I don't know whether you want to hear this, but can I ask you to
    reconsider the idea of centering all content?

    Centered headings make sense, but centered text is quite hard to
    read. It's also unattractive to my eyes,though that last part is a
    matter of opinion.

    --
    Stan Brown, Oak Road Systems, Tompkins County, New York, USA

    HTML 4.01 spec: http://www.w3.org/TR/html401/
    validator: http://validator.w3.org/
    CSS 2.1 spec: http://www.w3.org/TR/CSS21/
    validator: http://jigsaw.w3.org/css-validator/
    Why We Won't Help You:

    Comment

    • Els

      #3
      Re: Centering All Content

      SamMan wrote:
      [color=blue]
      > A few months ago, I recalled reading somewhere the way to center content in
      > Mozilla-based browsers was like this...
      >
      > body {
      > margin: 0px auto;
      > text-align: center; /*for IE*/
      > }
      >
      > My memory recalls this working, but now upon revisiting, it is not. What is
      > the proper way to center content?[/color]

      Almost right ;-)

      Put the text-align:center on the body, and the auto left and right
      margins on the element that holds your content.


      --
      Els http://locusmeus.com/
      Sonhos vem. Sonhos vão. O resto é imperfeito.
      - Renato Russo -

      Comment

      • SamMan

        #4
        Re: Centering All Content

        "Els" <els.aNOSPAM@ti scali.nl> wrote in message
        news:fhd4z7bzyz 53.1aqs30j75u2l $.dlg@40tude.ne t...[color=blue]
        > SamMan wrote:
        >[color=green]
        >> A few months ago, I recalled reading somewhere the way to center content
        >> in
        >> Mozilla-based browsers was like this...
        >>
        >> body {
        >> margin: 0px auto;
        >> text-align: center; /*for IE*/
        >> }
        >>
        >> My memory recalls this working, but now upon revisiting, it is not. What
        >> is
        >> the proper way to center content?[/color]
        >
        > Almost right ;-)
        >
        > Put the text-align:center on the body, and the auto left and right
        > margins on the element that holds your content.
        > http://locusmeus.com/html-css/centeringpage.html
        >
        > --
        > Els http://locusmeus.com/
        > Sonhos vem. Sonhos vão. O resto é imperfeito.
        > - Renato Russo -[/color]


        Not what I remember, but it certainly works!

        Thanks.

        --
        SamMan
        Rip it to reply



        Comment

        Working...