This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
ideas:centering [2008/02/02 16:06] – bkemper | ideas:centering [2008/02/02 16:17] – bkemper | ||
---|---|---|---|
Line 28: | Line 28: | ||
This leaves one way left to keep the object centered when overflow is set to “visible” (the default) or “hidden”: | This leaves one way left to keep the object centered when overflow is set to “visible” (the default) or “hidden”: | ||
- | |||
==== Proposals ==== | ==== Proposals ==== | ||
Line 60: | Line 59: | ||
=== block-align property === | === block-align property === | ||
- | Its been proposed that a property called “block-align” would be useful for centering block level content. Vadim Plessky mentioned it in 2001 (here and here), and more recently David Baron brought it up as a way to separate the block centering behavior of “< | + | Its been proposed that a property called “block-align” would be useful for centering block level content. Vadim Plessky mentioned it in 2001 ([[http:// |
Given that CSS already has a property called “text-align” to horizontally align line boxes, “block-align” would logically be analogous to that, but for block level content. Given that “text-align” is well documented and well understood, having a block level version call “block-align” would lead to easy understanding of what it does in turn. This helps solidify the answers to the similar " | Given that CSS already has a property called “text-align” to horizontally align line boxes, “block-align” would logically be analogous to that, but for block level content. Given that “text-align” is well documented and well understood, having a block level version call “block-align” would lead to easy understanding of what it does in turn. This helps solidify the answers to the similar " | ||
Line 75: | Line 74: | ||
== Other values: == | == Other values: == | ||
- | The default value of block-align is “left” (when the text-direction is LTR), or “start”, | + | The default value of block-align is “left” (when the text-direction is LTR) or “start”, |
When thought of this way (as a property whose default value describes the existing behavior of block alignment), it is clear how the property would interact with margins. Descendants with margins set to auto would not have their centered alignment overridden by the block alignment of their parent (whatever its value), just as they are not currently. Likewise, the current behavior makes it clear that an object with “block-align: | When thought of this way (as a property whose default value describes the existing behavior of block alignment), it is clear how the property would interact with margins. Descendants with margins set to auto would not have their centered alignment overridden by the block alignment of their parent (whatever its value), just as they are not currently. Likewise, the current behavior makes it clear that an object with “block-align: | ||
Line 134: | Line 133: | ||
* The way “left”, “right”, | * The way “left”, “right”, | ||
* It may be more intuitive to think of the center as being “50%”, as with “background-position” or “top” or “left”. However, this may make the values for “right” and “bottom” more confusing for novices. | * It may be more intuitive to think of the center as being “50%”, as with “background-position” or “top” or “left”. However, this may make the values for “right” and “bottom” more confusing for novices. | ||
- | |||
- |