r9040 - in spip: dist ecrire/inc

Author: cedric@yterium.com
Date: 2007-04-14 21:39:44 +0200 (sam, 14 avr 2007)
New Revision: 9040

Log:
ne pas imposer la largeur de la page sur #page
il faut utiliser text-align:center et margin:auto sur les enfants pour centrer la page

Modified:
   spip/dist/style_prive.html
   spip/ecrire/inc/commencer_page.php
   spip/ecrire/inc/presentation.php

Details: http://trac.rezo.net/trac/spip/changeset/9040

cedric@yterium.com ha scritto:

Author: cedric@yterium.com
Date: 2007-04-14 21:39:44 +0200 (sam, 14 avr 2007)
New Revision: 9040

Log:
ne pas imposer la largeur de la page sur #page
il faut utiliser text-align:center et margin:auto sur les enfants pour centrer la page

Why?
The page layout is of fixed width. Why do we have center and set width to all the children of the page if we can center and set width for the whole page once and for all?

margin:0 auto works well to center block elements of fixed width, and it's in class "centered".

Other thing is centering the inline content of these blocks, and that is text-align:center, but it is not the same thing.

We could want a block centered in the page but with its text normally left aligned.

Could you explain why you say we must set text-align:center and margin:auto on all the children instead of on the page element only?

Ciao
Renato

Renato Formato a écrit :

cedric@yterium.com ha scritto:

Author: cedric@yterium.com
Date: 2007-04-14 21:39:44 +0200 (sam, 14 avr 2007)
New Revision: 9040

Log:
ne pas imposer la largeur de la page sur #page
il faut utiliser text-align:center et margin:auto sur les enfants pour centrer la page

Why?
The page layout is of fixed width. Why do we have center and set width to all the children of the page if we can center and set width for the whole page once and for all?

the table is fixed witdh, and i hope it will soon disapear !

margin:0 auto works well to center block elements of fixed width, and it's in class "centered".

Other thing is centering the inline content of these blocks, and that is text-align:center, but it is not the same thing.

We could want a block centered in the page but with its text normally left aligned.

Could you explain why you say we must set text-align:center and margin:auto on all the children instead of on the page element only?

sorry there was a missing comma :
il faut utiliser text-align:center (on the parent),
et margin:auto sur les enfants pour centrer la page

so margin:auto on the children
and moreover text-align:left/right to cancel inherited text-align:center

The reason is that #page was former a 100% width div and some plugins use all the width of the page for large data
When fixing the width of #page all is now broken !

Cedirc

Je ne sais pas si c'est relié, mais le exec=brouteur est tout pêté :slight_smile: