On 22.05.2012 06:34, mem wrote:
My question is: It seems to me that, using text-align:center; should serve the propose of centering text and NOT img and other nested divs, am I wrong ?
Yes, in that 'text-align: center' centers "inline-level" elements/content and not "block-level" elements. Since you can alter "inline-level" elements to become "block-level" elements, and the other way round, you have to keep track of what level each element actually is at when you style nested elements.
An 'img' is for instance "inline-level" by default, and will therefore be centered by 'text-align: center', if you haven't redefined the 'img' to become a "block-level" element by means of a general or specific declaration for images.
Also, elements nested inside an element with 'text-align: center' declared on it, will inherit that declaration unless or until you override it by another 'text-align' declaration. So although nested "block-level" elements won't themselves be centered, their "inline-level" content will be centered by the inherited declaration.
Philippe has covered the rest... :-) regards Georg ______________________________________________________________________ css-discuss [css-d@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/