Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 06-23-2014, 03:56 AM   #1
Leonatus
Wizard
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
Posts: 1,050
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
@page margin settings

I never really understood the functionality of margins, padding, borders in ebooks (for I don't know how the boxes are defined there - and didn't find anything in the www.).

But I have often been wondering why the margins of ebook text often were very close to the edges of my reader, so that it almost became uncomfortable to read, despite of having the "body" settings in the css at:

Code:
margin-top: 5px;
margin-bottom: 5px;
margin-left: 5px;
margin-right: 5px;
This weekend, I did some thinking about it, removed those settings, and added, on the top of the css a style:

Code:
@page 
{
margin: 5px;
}
for my reasoning was that this should create sort of "allover" box and be more proper to define the distance to the screen edges of the device itself.
Have no clue if this is formally correct, but:

Lo! It worked: Now there was enough space there.
Leonatus is offline   Reply With Quote
Old 06-23-2014, 04:13 AM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,550
Karma: 145863177
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Actually, you don't need the bottom margin set. There's usually space between the bottm line and the bit at the bottom used by the Reader.
JSWolf is offline   Reply With Quote
Advert
Old 06-23-2014, 12:52 PM   #3
DomesticExtremis
Addict
DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.
 
DomesticExtremis's Avatar
 
Posts: 243
Karma: 359054
Join Date: Nov 2012
Device: default
W3 Box model
DomesticExtremis is offline   Reply With Quote
Old 06-23-2014, 04:37 PM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,988
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by JSWolf View Post
Actually, you don't need the bottom margin set. There's usually space between the bottm line and the bit at the bottom used by the Reader.
I like to leave the bottom margins (everywhere when possible) at 0 because it can sometimes force a page overflow (the dreaded blank page)

Anything following the previous block can set a TOP margin to get a wanted gap
theducks is offline   Reply With Quote
Old 06-24-2014, 04:24 AM   #5
Leonatus
Wizard
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
Posts: 1,050
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
@DomesticExtremis: Thank you for the hint, but there appears:
"Each box has a content area (e.g., text, an image, etc.) and optional surrounding padding, border, and margin areas."
Does this mean - transposed to the use of ebook readers - that one can deliberately decide if he wants, for example, the margins of a text set by controlling the padding, border or margin box commands? Where would I have to assign the @page rule?

That's what I do not understand.
Leonatus is offline   Reply With Quote
Advert
Old 06-24-2014, 11:40 AM   #6
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,988
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Leonatus View Post
@DomesticExtremis: Thank you for the hint, but there appears:
"Each box has a content area (e.g., text, an image, etc.) and optional surrounding padding, border, and margin areas."
Does this mean - transposed to the use of ebook readers - that one can deliberately decide if he wants, for example, the margins of a text set by controlling the padding, border or margin box commands? Where would I have to assign the @page rule?

That's what I do not understand.
Open this simple box (model) sample in Sigil or Calibre' editor

Play with the values and see the results.
IMHO The easy way to get a feel for the basic box model
Attached Files
File Type: epub wordinboxTEST.epub (1.9 KB, 177 views)
theducks is offline   Reply With Quote
Old 06-24-2014, 01:04 PM   #7
DomesticExtremis
Addict
DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.
 
DomesticExtremis's Avatar
 
Posts: 243
Karma: 359054
Join Date: Nov 2012
Device: default
Quote:
Originally Posted by Leonatus View Post
@DomesticExtremis: Thank you for the hint, but there appears:
"Each box has a content area (e.g., text, an image, etc.) and optional surrounding padding, border, and margin areas."
Does this mean - transposed to the use of ebook readers - that one can deliberately decide if he wants, for example, the margins of a text set by controlling the padding, border or margin box commands? Where would I have to assign the @page rule?

That's what I do not understand.
The @page rule applies to paged media - in the case of the e-reader the screen onto which the html document is rendered. you can only set margins with this rule, and they are applied to the 'screen', irrespective of how the html has been flowed or split across pages.

More here.

The box model can be applied to any block element, so that you can have different margins/padding/borders for paragraphs, blockquotes and other bits.

You do not have to set an @page, and your e-reader my override/ignore it anyway.
DomesticExtremis is offline   Reply With Quote
Old 06-25-2014, 02:26 AM   #8
Leonatus
Wizard
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
Posts: 1,050
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
Quote:
Originally Posted by DomesticExtremis View Post
The @page rule applies to paged media - in the case of the e-reader the screen onto which the html document is rendered. you can only set margins with this rule, and they are applied to the 'screen', irrespective of how the html has been flowed or split across pages.

The box model can be applied to any block element, so that you can have different margins/padding/borders for paragraphs, blockquotes and other bits.

You do not have to set an @page, and your e-reader my override/ignore it anyway.
This is very clarifying, and would have helped me a lot in the past (it might help me in the future, hopefully). I didn't really understand, for example, how it works to make one paragraph extend wider than the other. I only tried some things, waiting for the effects, but it's of course better to understand the context.

You are right: some things work, other do not. Lately, I transferred a book to the reader with the @page rule by Calibre, and the rule was ignored. By hasard, I had to delete this book, worked it up in Sigil (without changing the css), and fetched it to the reader again, and voilà: the margins had become nicer. The world is full of miracles.
Leonatus is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing margin settings from epub treadlightly Kobo Reader 5 12-07-2013 08:58 PM
Kobo Glo losing margin settings antonf Kobo Reader 1 02-07-2013 05:01 PM
Changing Margin Settings to use full width of the Screen??? JBlyth Kobo Reader 9 07-05-2010 09:54 AM
Changing Margin Settings to use full width of the Screen JBlyth Kobo Reader 0 07-02-2010 10:31 PM
Quick question! margin settings? nick_f Sony Reader 15 02-20-2009 02:15 PM


All times are GMT -4. The time now is 04:26 AM.


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