why the img-caption text is not centering ?
It does work your other elements are interfearing with it.
When I added
<figurecaption> and added
#img-caption to that div, it was centered.
<div id="img-caption"> <figurecaption> The Missile Man of India </figurecaption> </div>
can you specify which elements ?
You have defined an element with
id="img-div", but have
#imd-div in the CSS. After changing that, I suggest you use something like this:
display: flex; flex-direction: column;
#img-div in the CSS.
Hope this helps
why it worked ? how its related to #img-caption ?
You have an invalid element
figurecaption. It should be figcaption. If you change it to the correct element it will be a block-level element and will center.