I'm not sure what exactly you're asking.
Once you have an image file, you need to 1) point to it within the code. Then 2) apply a centering and preferably 3) a height and/or width specification as well.
How you do those three things can vary. Your two options are basically the same thing.
Here's an example from a Penguin ebook:
<div class="centerAligned">
<img alt="001" src="doyl_9781440673726_msr_cvi_r1.jpg" style="height:100%; text-align:center;"/>
</div>
This code is applying two different centering instructions. One or the other is
superfluous but it probably comes from a template that the programmer was using.
In case it isn't perfectly obvious, any classes referenced should be defined in the CSS file or in the <STYLE> section of the given page.
|