Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 11-29-2015, 11:34 AM   #1
1v4n0
Groupie
1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.
 
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
position:absolute and the disappearing html file

Hello.

I did some positioning in an AZW3. The code goes like this

Code:
<div class="sgc1">
    <p>ONE SHORT LINE</p>

    <p>another one</p>

    <p>3rd shortline</p>
  </div>

  <p class="sgc3"><img src="../images/00002.jpeg"/></p>
And in the CSS i gave position:absolute to the sgc1 and sgc3, the former with top:10% and the latter with bottom: 0.

To my surprise, the html file in question didn't show up in the kindle. It was simply skipped. It did show correctly, though, in the calibre previewer. I changed the sgc1 (and only that) to margin-top:10%, with no position declaration, and the file appeared again.

Any idea what's going on? I tried this on two different devices, a paperwhite and an older one.

Thanks

Last edited by 1v4n0; 11-29-2015 at 11:47 AM.
1v4n0 is offline   Reply With Quote
Old 11-29-2015, 01:33 PM   #2
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
position: absolute isn't allowed in Kindle books. If you compile a book that uses it, you'll get the following warning:
Quote:
Warning(htmlprocessor):W28003: Value specified for CSS property in content is not supported by Kindle readers. Please refer Kindle Publishing Guidelines about usage of property: 'position: absolute'
Doitsu is offline   Reply With Quote
Old 11-29-2015, 04:27 PM   #3
1v4n0
Groupie
1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.
 
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
ah, that's good to know. Any workarounds? Not that I use it a lot, but still-
1v4n0 is offline   Reply With Quote
Old 11-29-2015, 06:10 PM   #4
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
There's not really a good alternative to position:absolute. It's a very basic, very critical part of the CSS specification. What you should avoid doing is using it to specify a page-relative absolute position, because that will not necessarily behave in the way you might expect, but this should be obvious to anybody who has ever done any significant amount of web development, making that warning from kindlegen pretty pointless.

FYI, my drop cap CSS on Kindle uses position:absolute, and I haven't seen any problems from doing so. AFAIK, neither has anyone else. I wouldn't use absolute positioning in KF7 code, but as long as you're only using it on the KF8 side, it should be safe to ignore the warning.
dgatwood is offline   Reply With Quote
Old 11-30-2015, 04:12 AM   #5
1v4n0
Groupie
1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.
 
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
Well what surprised me is that the kindle skipped the html file altogether, but only if the first <p> had absolute positioning (or maybe it's because it can only tolerate one "absolutely-positioned" item per file?)

Also, the positioning for the image at the bottom does in fact work.

As for KF7 vs KF8, I don't know what you're talking about

This is an AZW3 I got from an EPUB I did, via calibre conversion.

TY all.
1v4n0 is offline   Reply With Quote
Old 11-30-2015, 05:30 PM   #6
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by 1v4n0 View Post
Well what surprised me is that the kindle skipped the html file altogether, but only if the first <p> had absolute positioning (or maybe it's because it can only tolerate one "absolutely-positioned" item per file?)

Also, the positioning for the image at the bottom does in fact work.

As for KF7 vs KF8, I don't know what you're talking about

This is an AZW3 I got from an EPUB I did, via calibre conversion.

TY all.
Ah. I should have read your original post more carefully. You probably shouldn't use absolute positioning in the way you're using it, because it isn't relative to an enclosing element.

You can safely use absolute positioning on elements that are inside any enclosing element that is positioned in a non-fixed manner. Just don't use absolute positioning on elements whose ancestors are all position:fixed (the default).

This is probably a bug in whatever version of WebKitGTK Amazon branched from.
dgatwood is offline   Reply With Quote
Old 12-01-2015, 07:21 AM   #7
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
Quote:
Originally Posted by 1v4n0 View Post
As for KF7 vs KF8, I don't know what you're talking about

This is an AZW3 I got from an EPUB I did, via calibre conversion.
KF7 (no style sheet) = K1, K2, some K3, and DX Kindles.
KF8 = more recent Kindles, Fires, and apps.

I don't build the books any differently for the two formats. (Amazon is now moving into KFX; see the thread on that subject.) They look okay on both, though one can't control the size of images on KF7 devices.

I'd keep Calibre out of it. I upload the epub to the KDP and let it convert there.
Notjohn is offline   Reply With Quote
Old 12-01-2015, 07:37 AM   #8
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Notjohn View Post
KF7 (no style sheet) = K1, K2, some K3, and DX Kindles.
K3 Kindles support KF8 files with a firmware update. (K3 owners who never installed the firmware update are unlikely to buy books from Amazon anyway.)
Doitsu is offline   Reply With Quote
Old 09-19-2017, 09:12 AM   #9
Kamikuza
Connoisseur
Kamikuza began at the beginning.
 
Posts: 62
Karma: 10
Join Date: May 2011
Location: Japan
Device: Kindle3
Uuuurgh zombie thread . . . brains . . .

My workflow: Sigil 0.8.1 --> KP 2.942 --> .mobi --> PW2

I've been experimenting with position:absolute and :fixed so my title pages look like the book's title pages, with the publisher name fixed to the bottom of the page (or the title in the exact center) regardless of the font size and no need for fudging things with tables and endless fiddling with margins. . . .

Seems to work fine, with the following caveats:

1. You MUST have a normal html/css thingy at the top, otherwise the whole page disappears. You gotta have something "above" it -- but not a space character.
eg.
<body>
<div style="background-color:none; bottom:0; height:min-height; left:0; padding:0; position:fixed; width:100%;"><p>Simon & Specter</p>
<p style="color:white;">.</p>
</body>

will display a page with a "hidden" full stop at the top and the publishers name at the bottom -- no matter what font size you select.

2. If you left- or right-align the absolute text, it seems to go to the absolute edge of the page -- past the margins the rest of the text will follow. I can't see a way around that except to set "left:70px" or whatever . . .

...

You can do something similar with vertically centering some text too.

I'm doing this for my own enjoyment, not publishing so they don't need to be compatible with . . . well, anything

If anyone has a better method, I'd be keen to hear it.
Kamikuza is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pocketbook 622 doesn't remember last position of a djvu file marmistrz PocketBook 2 06-19-2015 12:37 PM
Line spacing disappearing in .mobi file John123 Workshop 6 12-15-2012 08:39 AM
HTML input plugin stripping text within toc tags in child html file nimblebooks Conversion 3 02-21-2012 03:24 PM
Trying to upgrade my kindle 3 to 3.03, but the downloaded file keeps disappearing. Bruce Wells Amazon Kindle 2 01-14-2011 12:23 AM
ePub not supported < div > position: absolute samsgates ePub 1 06-18-2010 11:22 AM


All times are GMT -4. The time now is 05:21 AM.


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