Quote:
Originally Posted by fbrzvnrnd
It's correct: but the figure content usually does not have text as content. It could have <p> and the <p> has - as content - text. A block element inside a block element with "text-align" is not centered (or at least it shouldn't) AFAIK
|
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.