12-20-2012, 10:25 PM | #16 | |
Curmudgeon
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
|
Quote:
It might also be worth using min-height instead of height just in case A. your content ends up on a device that doesn't support SVG, B. your fallback content is used, and C. it is taller than a screenful. In other words: Code:
<html style="min-height: 100%; width: 100%; padding: 0; margin: 0; border-width: 0;"> <body style="min-height: 100%; width: 100%; padding: 0; margin: 0;border-width: 0;"> <div style="min-height: 100%; width: 100%; padding: 0; margin: 0; border-width: 0;"> <object data="..." preserveAspectRatio="..." viewBox="0 0 100% 100%"> Optional non-SVG fallback HTML or image here </object> </div> </body> </html> In an ideal world, we would all just use the new CSS3 viewport-relative lengths (vw and vh), but I suspect it will be many years before you can count on that unit being supported broadly enough to be useful. |
|
12-21-2012, 06:17 AM | #17 |
frumious Bandersnatch
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Specifying 100% for html and below could work according with the spec, but I wouldn't trust readers to comply. On the other hand, it's only a solution if a file contains an image and nothing else (like a cover page), it's no good for mid-text illustrations.
|
Advert | |
|
12-21-2012, 06:46 AM | #18 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Some readers will actually give strange results if you set the <html> and/or <body> to 100%. For example in some cases the PRS-T1 will not advance to another page unless specifically the page number is entered.
|
12-21-2012, 11:45 AM | #19 | |
Curmudgeon
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
|
Quote:
If it fails in this way with min-height: 100% and a single-page SVG image, however, then the reader is broken (and this seems much more unlikely). The specification is unambiguous about how that should be handled, and if you find that it does not work on the Sony reader, please file bug reports with Sony. They really need to fix that bug, as designs that include full-page-size images (for things like title pages) are likely to become more and more common as time passes, not less. Last edited by dgatwood; 12-21-2012 at 11:50 AM. |
|
12-28-2012, 04:46 PM | #20 | |
Curmudgeon
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
|
Quote:
Because of a rather severe ambiguity in the CSS specification (Thanks, W3C), some browsers treat the parent element's height as zero if it is constrained only by a min-height. I consider that interpretation to be incorrect, but it's a popular interpretation, exhibited by both WebKit and Firefox. *sigh* |
|
Advert | |
|
12-28-2012, 07:37 PM | #21 |
Curmudgeon
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
|
-----
Deleting erroneous reply. Last edited by dgatwood; 12-28-2012 at 07:40 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[kindle touch] zoom image? | zerolucat | Kindle Developer's Corner | 4 | 10-31-2012 02:58 PM |
Zoom in/out image | victorhugoa | ePub | 3 | 12-15-2011 04:40 AM |
Image Zoom | Kittel68 | Amazon Kindle | 3 | 06-28-2011 02:17 PM |
Workaround for lack of capitals in ADE | ozaru | ePub | 11 | 09-02-2010 08:59 PM |