Re: Just a simple centred DIV!

Discussion in 'HTML' started by bengee, Jul 21, 2003.

  1. bengee

    bengee Guest

    Nick Howes wrote:
    > Hi
    > I've got some content in a fixed-width DIV element, which I just want to
    > be horizontally centred on the screen, but the "align=center" DIV property
    > and "text-align:center" style property just centre the contents of the DIV.
    > I really don't want to have to put everything into a single-celled table and
    > centre that :) but I can't find any straightforward way to do this.


    <div style="margin: auto;"></div>

    Ben
     
    bengee, Jul 21, 2003
    #1
    1. Advertising

  2. bengee

    Nick Howes Guest

    > > I've got some content in a fixed-width DIV element, which I just
    want to
    > > be horizontally centred on the screen,

    >
    > <div style="margin: auto;"></div>
    >


    Thanks, although that works in opera 6, but not IE 6.0. Any ideas?
     
    Nick Howes, Jul 21, 2003
    #2
    1. Advertising

  3. In article <bfhgt6$926$>, Nick Howes wrote:
    > > > I've got some content in a fixed-width DIV element, which I just

    > want to
    > > > be horizontally centred on the screen,

    > >
    > > <div style="margin: auto;"></div>
    > >

    >
    > Thanks, although that works in opera 6, but not IE 6.0. Any ideas?


    IE6 is in quirks mode. Use doctype suitable doctype:
    http://gutfeldt.ch/matthias/articles/doctypeswitch.html


    --
    Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
    Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
    tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.
     
    Lauri Raittila, Jul 22, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nico Schuyt

    Re: Just a simple centred DIV!

    Nico Schuyt, Jul 21, 2003, in forum: HTML
    Replies:
    1
    Views:
    393
    Nick Howes
    Jul 21, 2003
  2. Floortje

    layer in centred table

    Floortje, Apr 13, 2004, in forum: HTML
    Replies:
    1
    Views:
    355
    Spartanicus
    Apr 13, 2004
  3. tHatDudeUK
    Replies:
    6
    Views:
    412
    Richard
    Jan 13, 2005
  4. Luigi Donatello Asero

    Centred headers browsed at Firefox

    Luigi Donatello Asero, Oct 14, 2005, in forum: HTML
    Replies:
    44
    Views:
    1,114
    kchayka
    Oct 17, 2005
  5. Michael Laplante

    Centred image with caption

    Michael Laplante, Aug 8, 2006, in forum: HTML
    Replies:
    6
    Views:
    397
    Beauregard T. Shagnasty
    Aug 9, 2006
Loading...

Share This Page