Quote:
Originally Posted by JSWolf
Here is the code in the XML for displaying the image centered followed by the relevant CSS code...
Code:
<p class="image"><img alt="" src="2.jpg"/></p>
Code:
p {
margin-top: 0;
margin-bottom: 0;
text-indent: 1.2em
}
.image {
display: block;
text-align: center;
text-indent: 0
}
There nothing auto. There's no inline anything. There no workarounds. It just works.
|
Try using that to display a graphics drop cap or any other graphics inline with text, hence my preference for inline-block. I've seen a lot of epubs that try to display centered graphics by using code similar to the following:
Code:
.image {
display: block;
margin-left: auto;
margin-right: auto;
}
This works until you meet a renderer that does not support the margin: auto directive. For whatever reason, Adobe is in that camp.
Also note the using text-align with graphics is not a recommended technique and should be avoided even though it works at least 95% of the time.
Regards,
David