In EPUB 3 FXL, if the body element has the CSS property position, its implicit width becomes zero in Kobo iOS. As a consequence, descendants with percentage-based absolute positioning relative to the page (i.e. not contained within another element with an explicit position property) are always placed in the top-left corner of the viewport (i.e., top: 0; left; 0;).
displays correctly in a browser and Kobo for Mac 3.12.0 running on OS X 10.10.3, but not so in Kobo for iOS 7.4 on an iPad 3 running iOS 8.1.3 (not tested on any other Kobo app/device):
(This issue describes only the positioning bug illustrated in the screenshot. The reason why the text box in Kobo iOS, besides being in a wrong position, has its lines broken after each word is described in https://github.com/dvschultz/99problems/issues/49 )
Removing the bodyelement's CSS property position corrects the issue in Kobo for iOS, but breaks it on desktop browsers.
You might have added position: relative along with width and height in px to the body for the purpose of previewing such pages in a desktop browser for editing or QA purposes. Desktop browsers have windows of variable size and disregard the viewport dimensions' declaration. Therefore, descendant elements whose dimensions and positions are percentage-based relative to the body would not display correctly on desktop browsers, unless body has explicit width and height in px and position. Ereaders, having fixed viewport sizes, do not need those, but having them present or not should make not difference for ereaders provided the body CSS dimensions match those of the viewport meta tag.
Note: this bug is actually a consequence of https://github.com/dvschultz/99problems/issues/49
In EPUB 3 FXL, if the
body
element has the CSS propertyposition
, its implicitwidth
becomes zero in Kobo iOS. As a consequence, descendants with percentage-based absolute positioning relative to the page (i.e. not contained within another element with an explicitposition
property) are always placed in the top-left corner of the viewport (i.e.,top: 0; left; 0;
).An XHTML file with this markup:
displays correctly in a browser and Kobo for Mac 3.12.0 running on OS X 10.10.3, but not so in Kobo for iOS 7.4 on an iPad 3 running iOS 8.1.3 (not tested on any other Kobo app/device):
(This issue describes only the positioning bug illustrated in the screenshot. The reason why the text box in Kobo iOS, besides being in a wrong position, has its lines broken after each word is described in https://github.com/dvschultz/99problems/issues/49 )
Removing the
body
element's CSS propertyposition
corrects the issue in Kobo for iOS, but breaks it on desktop browsers.You might have added
position: relative
along withwidth
andheight
inpx
to thebody
for the purpose of previewing such pages in a desktop browser for editing or QA purposes. Desktop browsers have windows of variable size and disregard theviewport
dimensions' declaration. Therefore, descendant elements whose dimensions and positions are percentage-based relative to thebody
would not display correctly on desktop browsers, unlessbody
has explicitwidth
andheight
inpx
andposition
. Ereaders, having fixed viewport sizes, do not need those, but having them present or not should make not difference for ereaders provided thebody
CSS dimensions match those of the viewport meta tag.