09-12-2019, 12:07 AM | #1 |
Connoisseur
Posts: 97
Karma: 200000
Join Date: Aug 2019
Device: none
|
Centering svg node in xhtml
Cover page uses svg so that I can typeset text on the image and text is always sharp regardless of the device resolution.
In portrait works fine - the aspect ratio of devices are such that the image is always 100% of width. But in landscape the image is the way the left and nothing I've tried w/ CSS will center it. Code:
<body> <div class="coverpage"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100%" height="100%" viewBox="0 0 800 1120" preserveAspectRatio="xMinYMin"> <!-- svg code --> </svg> </div> </body> |
09-12-2019, 12:20 AM | #2 |
Grand Sorcerer
Posts: 6,574
Karma: 84812983
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
|
"xMinYMin" means put the image in the upper left corner. Use "xMidYMid" to center it horizontally and vertically.
|
Advert | |
|
09-13-2019, 12:46 AM | #3 |
Connoisseur
Posts: 97
Karma: 200000
Join Date: Aug 2019
Device: none
|
THANK YOU !!!
Worked |
Tags |
css, svg |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Conversion from xhtml to epub loose svg images | pwessel | Conversion | 3 | 05-24-2015 11:29 PM |
Guide for converting Kindle Topaz (xhtml with svg) to PDF | Fschumaur | Workshop | 5 | 03-27-2015 01:35 AM |
Centering SVG graphics in iBooks? | FunkeXMix | ePub | 8 | 01-04-2013 09:21 PM |
XHTML fallback for SVG | Iznogood | ePub | 15 | 10-08-2012 07:52 PM |
How can I convert topaz ebook from multiple xhtml's (SVG) to single pdf? | rglk | Workshop | 3 | 11-28-2011 04:33 PM |