Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 02-08-2017, 01:44 PM   #1
chaot
Head of lunatic asylum
chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.
 
chaot's Avatar
 
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
pagestyle.css extra / integrated in stylesheet.css / or not at all?



This time the title says almost everything, right?

I got books which an extra pagestyle.css file.

Click image for larger version

Name:	pagestyle.css.png
Views:	328
Size:	10.9 KB
ID:	154857
pagestyle.css

The CSS looks most time somehow like this
Code:
@page {
  margin: 5px;
  }
That means, the pages coming in an ereader frame all around (top, bottom, left, right) 5px smaller.
I delete such an pagestyle.css (or put it to zero) - I want to see the characters (words) of the book and not a ''nice'' margin. (I think to make pagestyle (5px or even 10 px or more) is also a comercial argument - book got more pages.)

If I want pagestyle I can integrate it in the normal stylesheet, or not?

Do I need pagestyle for any purpose. I think no pagestyle is the same as pagestyle margin: 0.

Do pagestyle anyhow affect the CSS Box-model (margin/border/padding)?

Last edited by chaot; 02-08-2017 at 01:47 PM.
chaot is offline   Reply With Quote
Old 02-08-2017, 02:08 PM   #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: 73,894
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I do think you should dump pagestyle.css.an @page is not needed. The problem with @page is that is forces margins when a margin of 0 is best. A margin of0 is best so that when using programs/apps that have margin settings, you get the margins the user wants using the margin settings instead of some fixed margin with the options only being able to add to that.

Last edited by JSWolf; 02-08-2017 at 02:14 PM.
JSWolf is offline   Reply With Quote
Advert
Old 02-08-2017, 02:23 PM   #3
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,206
Karma: 16228558
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
@chaot,

The existence of page_styles.css suggests you have an epub created by a calibre conversion. If you don't want it created you should review your calibre conversion settings - specifically the 4 x Margin settings on the Page Setup page. I have all mine set to 'Unchanged' and the extra page_styles.css is not created during conversion.

Caveat: If your epub contains embedded fonts then converting it will still create page_styles.css file and all the @font-face css statements will have been moved into it.

Last edited by jackie_w; 02-08-2017 at 02:31 PM.
jackie_w is offline   Reply With Quote
Old 02-08-2017, 06:09 PM   #4
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,552
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by jackie_w View Post
I have all mine set to 'Unchanged' and the extra page_styles.css is not created during conversion.
since day 0 I've had mine set to 4 x 0, hoping that would get rid of it

BR
BetterRed is online now   Reply With Quote
Old 02-08-2017, 07:21 PM   #5
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
AFAIK the reason for a separate pagestyle.css was that the @page was not handled by certain devices. If that @page was included, it would disregard the entire stylesheet... so people would put it on its own sheet so it would not affect any other style commands.

I'm not sure if this is still an issue, but that's what I understood the reasoning to be...

Cheers,
Turtle91 is offline   Reply With Quote
Advert
Old 02-09-2017, 02:47 AM   #6
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by JSWolf View Post
I do think you should dump pagestyle.css.an @page is not needed. The problem with @page is that is forces margins when a margin of 0 is best. A margin of0 is best so that when using programs/apps that have margin settings, you get the margins the user wants using the margin settings instead of some fixed margin with the options only being able to add to that.
No, you feel it is not needed and that a margin of 0 is best. Don't confuse your personal opinions with other peoples opinions. I personally like a small margin for each page. I feel that putting the value to 0 puts the text too close to the bezel of my reader and making reading harder.
Not all readers support margin settings in their software. In fact, I like my reader to honor the stylesheet as much as possible and perhaps only allow changes to the font-size.

Then again, that is MY opinion and I fully understand that other people have other opinions and I do not impose that my opinion is superior.
Toxaris is offline   Reply With Quote
Old 02-09-2017, 05:23 PM   #7
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: 73,894
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Toxaris View Post
No, you feel it is not needed and that a margin of 0 is best. Don't confuse your personal opinions with other peoples opinions. I personally like a small margin for each page. I feel that putting the value to 0 puts the text too close to the bezel of my reader and making reading harder.
Not all readers support margin settings in their software. In fact, I like my reader to honor the stylesheet as much as possible and perhaps only allow changes to the font-size.

Then again, that is MY opinion and I fully understand that other people have other opinions and I do not impose that my opinion is superior.
The problem comes from programs/apps/Readers that do not have a margin control. Most modern programs/apps/Readers do have a margin control and setting a margin other than 0 can take full control out of the hands of the user. So in your opinion, what is the solution? Not all programs/apps/Readers that have a margin control can override the margins. So for those users, 0 is best.
JSWolf is offline   Reply With Quote
Old 02-10-2017, 01:54 AM   #8
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by JSWolf View Post
The problem comes from programs/apps/Readers that do not have a margin control. Most modern programs/apps/Readers do have a margin control and setting a margin other than 0 can take full control out of the hands of the user. So in your opinion, what is the solution? Not all programs/apps/Readers that have a margin control can override the margins. So for those users, 0 is best.
In my opinion programs/apps/Readers should not override any settings that is set in the stylesheet, with the exception of the font-size. Which can easily be done if the font-size is set in em. I feel that a lot of reading apps use 'overrides' because they think it is too hard to support the stylesheet and call it 'user friendly'.

Of course there are good and bad books out there, but in general a reading app should honor the stylesheet. Like I said, if there is no margin, the text is too close to the screen edge to read comfortably.
Toxaris is offline   Reply With Quote
Old 02-10-2017, 04:34 AM   #9
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: 73,894
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Toxaris View Post
In my opinion programs/apps/Readers should not override any settings that is set in the stylesheet, with the exception of the font-size. Which can easily be done if the font-size is set in em. I feel that a lot of reading apps use 'overrides' because they think it is too hard to support the stylesheet and call it 'user friendly'.

Of course there are good and bad books out there, but in general a reading app should honor the stylesheet. Like I said, if there is no margin, the text is too close to the screen edge to read comfortably.
The problem is that different people like things differently. I like a smaller margin and a smaller line-height than some. So if you put in no margins and no line-height, you can set the margin and line-height as you like and I can set these as I like. But, if you have a margin and line-height that you like, it might not be how I like or what the other person likes. Start with the lowest common options and let the user use the settings to change things.

There is one way to please everyone. No DRM and make it so the margins and line-height are set in the body style. Just edit the body style and you are good to go. It's really that simple. But in reality, it'll never be that simple.
JSWolf is offline   Reply With Quote
Old 02-10-2017, 12:06 PM   #10
chaot
Head of lunatic asylum
chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.
 
chaot's Avatar
 
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
Quote:
Originally Posted by Toxaris View Post
I feel that putting the value to 0 puts the text too close to the bezel of my reader and making reading harder.
My Tolino generates (values to 0) always a left/right margin of about 4mm (top/bottom even more) what I think is fairly enough.
chaot is offline   Reply With Quote
Old 02-20-2017, 02:55 AM   #11
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 Turtle91 View Post
AFAIK the reason for a separate pagestyle.css was that the @page was not handled by certain devices. If that @page was included, it would disregard the entire stylesheet... so people would put it on its own sheet so it would not affect any other style commands.
Specifically, unless they've improved things very recently, Adobe Digital Editions barfs on almost all @ rules except for @font and certain extremely basic @media rules. That means any reader based on RMSDK also fails in the same way, which means that readers are probably more likely to fail on @page rules than handle them correctly.
dgatwood is offline   Reply With Quote
Old 02-20-2017, 03:26 AM   #12
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
Quote:
Originally Posted by dgatwood View Post
Specifically, unless they've improved things very recently, Adobe Digital Editions barfs on almost all @ rules except for @font and certain extremely basic @media rules. That means any reader based on RMSDK also fails in the same way, which means that readers are probably more likely to fail on @page rules than handle them correctly.
This was fixed long ago, RMSDK10 (released 2014) has no problem with @page.
GeoffR is offline   Reply With Quote
Old 02-20-2017, 05:00 AM   #13
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by dgatwood View Post
Specifically, unless they've improved things very recently, Adobe Digital Editions barfs on almost all @ rules except for @font and certain extremely basic @media rules. That means any reader based on RMSDK also fails in the same way, which means that readers are probably more likely to fail on @page rules than handle them correctly.
Err, what? Even my (very) old PRS-300 from 2009 supports the @page perfectly fine.
Toxaris is offline   Reply With Quote
Old 02-20-2017, 11:58 PM   #14
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 Toxaris View Post
Err, what? Even my (very) old PRS-300 from 2009 supports the @page perfectly fine.
Interesting. It failed for me as recently as a couple of years ago. Maybe it's a problem that has periodically been fixed and rebroken, or maybe it was some specific subfeature of @page that I was experimenting with (perhaps @top-center).

And at last check, @media worked for simple things, like the standard Kindle strings, but broke with more interesting rules like these:

Code:
@media not screen {
...
}
@media screen and (max-device-width:960px) and (orientation:portrait) {
...
}
@media (-webkit-min-device-pixel-ratio: 2) {
...
}

Last edited by dgatwood; 02-21-2017 at 12:01 AM.
dgatwood is offline   Reply With Quote
Old 02-24-2017, 11:10 PM   #15
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by GeoffR View Post
This was fixed long ago, RMSDK10 (released 2014) has no problem with @page.
OK. I was simply mentioning where the technique came from... or at least my understanding of where it came from. As we all know, people tend to use the techniques they know without totally understanding why they do...

Is it wrong to put it on a separate sheet?? No. Is it necessary?? Maybe, maybe not. Are you willing to take a chance by putting it on the same sheet?? I am, because I know my reader of choice doesn't barf on it and I only code for my personal use.

Cheers,
Turtle91 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A proposal: help sorting css stylesheet roger64 Editor 47 09-08-2016 10:23 PM
stylesheet.CSS anyone? ProDigit ePub 81 12-26-2015 01:43 PM
Converting cm to em in css stylesheet roger64 ePub 41 06-13-2014 01:00 PM
css pseudo elements and adjacent combinators in extra css? ldolse Calibre 2 12-21-2010 05:09 PM
Where is the stylesheet.css? roger64 Sigil 4 03-23-2010 02:12 PM


All times are GMT -4. The time now is 07:06 AM.


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