View Single Post
Old 03-23-2021, 08:43 AM   #22
fbrzvnrnd
Fanatic
fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.
 
Posts: 559
Karma: 400004
Join Date: Feb 2009
Device: ONYX M96
Quote:
Originally Posted by jhowell View Post
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.
fbrzvnrnd is offline   Reply With Quote