09-20-2013, 09:31 AM | #1 |
Enthusiast
Posts: 28
Karma: 5010
Join Date: Apr 2011
Device: none
|
control div box, page breaks and margins?
Hi All,
I searched the web and can't seem to find any answer on this...maybe i'm looking for the wrong thing...but I'm using div.box in CSS with a background color to contain a sidebar text. The issue is text is reflowing and creates "unpleasant" visual with text align to top or bottom of the box. If there a way to add margin where the box is breaking? So at least text looks center? Thanks! |
09-20-2013, 12:53 PM | #2 | |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Last edited by RbnJrg; 09-21-2013 at 08:57 AM. |
|
Advert | |
|
09-20-2013, 10:08 PM | #3 |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
I second what RbnJrg said. Pictures would really help solidify exactly what you are trying to fix. Code samples are also great additions when wanting help! (Feel free to substitute in bogus text if there are copyright issues).
Also, keep in mind "degrading gracefully" if floating boxes do not work on the device (think old Kindle), and also keep in mind devices which users read on can be quite small (think cellphone). Here is a CSS floatbox that I used in one EPUB: Code:
span.floatright, span.floatleft { font-size: 75%; font-weight: bold; padding-bottom: 15px; padding-top: 15px; padding-left: 15px; padding-right: 0px; width: 25%; float: right; text-indent: 0; } Code:
<p><span class="floatleft">Under perfectly stationary conditions the stock of non-permanent resources would be identical with the stock of produced means of production.</span> As has already been remarked, most non-permanent resources owe their existence to the fact that they make investment possible without a temporary reduction in the income stream. All or nearly all the man-made equipment is non-permanent, and the greater part, although by no means all, of the non-permanent resources existing at any moment consists of man-made equipment. This brings us back to the relation of my definition of capital as the “stock of non-permanent resources” to the traditional one of the “produced means of production”.</p> Here are images of it in action: I have attached the actual WIP EPUB if anyone wants to take a look at it. Edit: Also, this might look nice combined with the textbox code I used here: https://www.mobileread.com/forums/sho...25&postcount=9 Last edited by Tex2002ans; 09-20-2013 at 10:32 PM. |
09-21-2013, 07:10 AM | #4 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
The textbox code works well in the Sony Library at small and medium text sizes, but runs off the edge of the page in large text size.
But for me, it is good enough, in most cases. |
09-21-2013, 04:38 PM | #5 | |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
There is a certain point where you just cannot shove a HUGE word in "25%" width. It is a balance between making it match the look of the original source, or getting all the information in there displayed. Usually information in floating boxes are not THAT important. In the case of that "falling back" on Kindle, it worked out great. It matched the look of some of his earlier books, where the bold words were at the beginning of the paragraphs. There is also this code I stumbled upon a while back, but haven't had the chance to test: http://www.natashafondren.com/writin...ndle-format-8/ Although for me, it seems to be quite unmaintainable code. Indeed, which is why I settled on that code. If anyone else has any other floating box examples they use, feel free to post! Then we can all start using it to make our EPUBs better. |
|
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre breaks image/div margins | dasboeh | ePub | 9 | 12-21-2012 01:15 PM |
PRS-T1 PRS-T1 - Changing page margins prevents 'touch' page turning | Berzelius | Sony Reader | 2 | 08-24-2012 04:02 AM |
Paragraph breaks when removing margins | Canorka | Conversion | 3 | 03-30-2012 02:00 AM |
epub to mobi h1 page breaks not starting on new page | wannabee | Conversion | 4 | 08-02-2011 12:46 AM |
Adding page breaks in Calibre breaks ePubcheck validation | bookraft | Conversion | 16 | 03-01-2011 01:23 PM |