Quote:
Originally Posted by jhowell
This is typical code for centering images. The <img> element is not a block element and is what gets aligned. <div> would work the same for the outer wrapper, but <figure> is more semantically informative. Using <p> would also work, but is semantically inferior and could introduce a skew to the centering because of indentation.
|
To be honest I never used the text-align for a <div> or a <figure> for semantic reason: in an ebook I prefer that texts are marked with <p> or other semantic tags for text. I see the <div> more as a divider for giving structure to a document and marking areas of the document where there are no valid semantic markers. So I never used the text-align CSS property for images, because, well, images are not text. I remember there was different problems using text-align for images, maybe the newer programs handle this aspect better.