How to break up HTML documents into pages for ebook?

回眸只為那壹抹淺笑 提交于 2019-12-03 02:51:46

You should look at the PagedMedia CSS module: http://www.w3.org/TR/css3-page/ CSS3 also support multicolumn layouts (google for "css3-multicol". I don't have enough Karma to include a second link here :-)

About your update: how about doing the layout of one single page, then use a DIV with overflow:hidden for the text part. Next thing would be to overlay a transparent item on top of that, that would programmatically scroll the inner content of the DIV PAGE_HEIGHT pixels up or down according to some navigation controls (or gestures).

The other option is to have a parent <div> with multiple css3 columns: link1, link2.
This works on Android:

<style type='text/css'>
div {
    width: 1024px; // calculated
    -webkit-column-gap: 0px;
    -webkit-column-width: 320px; // calculated
    }
p {
    text-align: justify;
    padding:10px;
    }
</style>

The CSS multicol suggestions are very interesting! However, and I hope it's ok to respond with another question: how would you go from splitting one or more long <p> elements into columns to having one particular of these columns being rendered in a WebView? The DOM hasn't changed, so you can't pick out an element and render it. What am I missing?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!