Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 07-31-2010, 11:48 AM   #1
amoroso
Groupie
amoroso ought to be getting tired of karma fortunes by now.amoroso ought to be getting tired of karma fortunes by now.amoroso ought to be getting tired of karma fortunes by now.amoroso ought to be getting tired of karma fortunes by now.amoroso ought to be getting tired of karma fortunes by now.amoroso ought to be getting tired of karma fortunes by now.amoroso ought to be getting tired of karma fortunes by now.amoroso ought to be getting tired of karma fortunes by now.amoroso ought to be getting tired of karma fortunes by now.amoroso ought to be getting tired of karma fortunes by now.amoroso ought to be getting tired of karma fortunes by now.
 
amoroso's Avatar
 
Posts: 185
Karma: 1004070
Join Date: Jul 2010
Location: Italy
Device: Kindle for Android, Google Play Books
How to center/fit page width SVG images with <OBJECT>

Based on discussion in another thread, I use the following CSS and XHTML for simple horizontally centered images with a caption:
Code:
div.figure { text-align: center; font-style: italic; font-size: 80%; margin: 1em 0; page-break-inside: avoid; }
div.figure img { page-break-after: avoid; }
div.figure p { text-align: center; text-indent: 0; margin-top: 1em; page-break-before: avoid; }
...
<div class="figure">
<img src="../Images/my-image.jpg" />
<p>Caption</p>
</div>
To insert an SVG image I instead use code like this:
Code:
<div class="figure">
<object type="image/svg+xml" data="../Images/my-image.svg">
<img alt="Fallback" src="../Images/my-image.jpg" />
</object>
<p>Caption</p>
</div>
How can I make sure that the SVG image is horizontally centered? Is it enough to put it inside <DIV>? Also, how can I make it fit all the page width?
amoroso is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
K3 - Fit to screen (width) for PDF nuke Amazon Kindle 0 09-30-2010 09:27 AM
Page Width kobo2010 Kobo Reader 4 05-10-2010 08:14 PM
PRS-600 How to make prs600 display PDF fit width? wifish Sony Reader 1 12-20-2009 12:28 PM
How A4 Jpeg to Fit the Page in DR1000s spuggy iRex 0 09-02-2009 04:47 AM
PDF Fit Visible per page/landscape view jessesn Sony Reader 4 10-02-2006 10:42 AM


All times are GMT -4. The time now is 11:20 AM.


MobileRead.com is a privately owned, operated and funded community.