Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Re: Just a simple centred DIV!

Reply
Thread Tools

Re: Just a simple centred DIV!

 
 
bengee
Guest
Posts: n/a
 
      07-21-2003
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

 
Reply With Quote
 
 
 
 
Nick Howes
Guest
Posts: n/a
 
      07-21-2003
> > 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?


 
Reply With Quote
 
 
 
 
Lauri Raittila
Guest
Posts: n/a
 
      07-22-2003
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Centred image with caption Michael Laplante HTML 6 08-09-2006 12:30 PM
Centred headers browsed at Firefox Luigi Donatello Asero HTML 44 10-17-2005 05:03 PM
Keeping all content centred and in the middle tHatDudeUK HTML 6 01-13-2005 02:39 AM
layer in centred table Floortje HTML 1 04-13-2004 08:18 PM
Re: Just a simple centred DIV! Nico Schuyt HTML 1 07-21-2003 08:28 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57