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

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 10-09-2019, 02:14 PM   #1
Imperative
Junior Member
Imperative began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2019
Device: Kobo Glo
Serious Trouble with the Book Viewer through the Use of CSS

Hello guys, I’ve got in real trouble while using a very primitive CSS in viewer:
Code:
body {
color: rgb(0,0,0)  !important;
background-color: rgb(228,226,224) !important;
line-height: 1 !important;
text-indent: 2em !important;
text-align: justify !important;
margin-top: 0px !important;
margin-bottom: 4px  !important;
margin-right: 10px !important;
margin-left: 50px !important;
font-family: Bookman Old Style !important;
font-size: 19px !important;
}
On the screenshot below you may see the problem with left margin.
Click image for larger version

Name:	left margin crazy.png
Views:	73
Size:	464.6 KB
ID:	174088

The lines related to the right and the bottom margins, as well as to text indent, make no difference to the book view. I’ve been trying to resolve this problem for a couple of days already and I haven’t found any similar problem through the web, so I am setting all my hopes for your help guys!
Imperative is offline   Reply With Quote
Old 10-09-2019, 02:33 PM   #2
Brett Merkey
Not Quite Dead
Brett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toys
 
Posts: 100
Karma: 5750
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
Quote:
real trouble while using a very primitive CSS in viewer
Yes, that looks like a very odd outcome, however it is not the result of your CSS by itself. Except for the use of the dangerous !important statement (which I assume you inserted for testing purposes), I test the CSS with no problems. Perhaps something in the structural HTML?

You mention "viewer." Are you referring to the latest Calibre viewer, or a previous version or another reading device? The screenshot actually looks much like the result I get when I insert large negative margins attached to the HTML root tag and view in the Calibre viewer. Calibre gags but the negative margins are meant for ultimate viewing in the Kindle Paperwhite so it is not really a problem.

Last edited by Brett Merkey; 10-09-2019 at 02:41 PM.
Brett Merkey is offline   Reply With Quote
Advert
Old 10-09-2019, 02:42 PM   #3
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: 53,642
Karma: 49384553
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
Quote:
Originally Posted by Imperative View Post
Hello guys, I’ve got in real trouble while using a very primitive CSS in viewer:
Code:
body {
color: rgb(0,0,0)  !important;
background-color: rgb(228,226,224) !important;
line-height: 1 !important;
text-indent: 2em !important;
text-align: justify !important;
margin-top: 0px !important;
margin-bottom: 4px  !important;
margin-right: 10px !important;
margin-left: 50px !important;
font-family: Bookman Old Style !important;
font-size: 19px !important;
}
On the screenshot below you may see the problem with left margin.
Attachment 174088

The lines related to the right and the bottom margins, as well as to text indent, make no difference to the book view. I’ve been trying to resolve this problem for a couple of days already and I haven’t found any similar problem through the web, so I am setting all my hopes for your help guys!
I've just tested this CSS code on Calibre 4.1's viewer and I did not have the same problem as shown. If you are not running Calibre 4.1, I suggest you update.
JSWolf is offline   Reply With Quote
Old 10-09-2019, 03:59 PM   #4
Imperative
Junior Member
Imperative began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2019
Device: Kobo Glo
Brett Merkey, the problem appears with any book (.epub, .fb2) I open with E-book Viewer of Calibre 4.1. Even more: I've just tried to open books with laptop (I use PC preferably) and I get the same result! I'm totally new to Calibre, so I used the CSS samples from the forum and tried to not interfere much with the program's perfomance.

Maybe I should somehow convert the book in order to properly view it? Or could it be my OS that does the trick? I use Win10 with russian interface, so maybe I should try to switch to english version? I don't know, nothing makes sense to my burning brain anymore...
Imperative is offline   Reply With Quote
Old 10-09-2019, 04:06 PM   #5
Brett Merkey
Not Quite Dead
Brett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toys
 
Posts: 100
Karma: 5750
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
Quote:
the problem appears with any book (.epub, .fb2)
That indicates that the problem is not the format nor the code. No more ideas. Kovid did suggest in another thread related to the viewer that perhaps an update to your computer's graphics driver? Did you also transfer a book and test how the books look in your Kobo reading device?

Last edited by Brett Merkey; 10-09-2019 at 04:19 PM.
Brett Merkey is offline   Reply With Quote
Advert
Old 10-09-2019, 05:08 PM   #6
Imperative
Junior Member
Imperative began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2019
Device: Kobo Glo
Brett Merkey, yes, the books look fine on my Kobo.

The switch to English interface of Windows doesn't help either. Oh God, is it going to be the fifth ebook reader for PC that doesn't meet my demands?.. Pff, I really like the application and I almost made my choice... there's gotta be a simple solution to this, some kind of one-click operation...
Imperative is offline   Reply With Quote
Old 10-09-2019, 05:46 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: 53,642
Karma: 49384553
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
Quote:
Originally Posted by Imperative View Post
Brett Merkey, yes, the books look fine on my Kobo.

The switch to English interface of Windows doesn't help either. Oh God, is it going to be the fifth ebook reader for PC that doesn't meet my demands?.. Pff, I really like the application and I almost made my choice... there's gotta be a simple solution to this, some kind of one-click operation...
Does it do this when you have the viewer widow at a more normal width? The OP's width is silly for reading (IMHO).
JSWolf is offline   Reply With Quote
Old 10-09-2019, 06:12 PM   #8
Imperative
Junior Member
Imperative began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2019
Device: Kobo Glo
Quote:
Originally Posted by JSWolf View Post
Does it do this when you have the viewer widow at a more normal width? The OP's width is silly for reading (IMHO).
Yes, it does. It still occurs no matter how many pages per screen I set. To change the maximum screen area used to display text also doesn't help.

It looks like some kind of software compatibility issue (first I thought it could be about hardware - huge size monitor) since the problem is so... rare?.. I would say, and nonetheless appears at both devices I use.
Imperative is offline   Reply With Quote
Old 10-09-2019, 06:17 PM   #9
Brett Merkey
Not Quite Dead
Brett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toysBrett Merkey shares his or her toys
 
Posts: 100
Karma: 5750
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
Quote:
yes, the books look fine on my Kobo
One more thing to look at within Calibre:
Preferences -> Look and Feel -> Main Interface -> Adjust for high resolution screens

Last edited by Brett Merkey; 10-09-2019 at 06:23 PM.
Brett Merkey is offline   Reply With Quote
Old 10-09-2019, 07:02 PM   #10
Imperative
Junior Member
Imperative began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2019
Device: Kobo Glo
Quote:
Originally Posted by Brett Merkey View Post
One more thing to look at within Calibre:
Preferences -> Look and Feel -> Main Interface -> Adjust for high resolution screens
Nope, nothing.

I've just noticed that I can't scroll FORWARD with the mouse wheel through the end of every html split. But I CAN scroll with the scroll bar anywhere! And I can scroll BACKWARDS with the mouse wheel through any split of the text. This limitation is quite strange.

Last edited by Imperative; 10-09-2019 at 07:04 PM. Reason: correcting post
Imperative is offline   Reply With Quote
Old 10-09-2019, 07:31 PM   #11
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: 23,816
Karma: 27735644
Join Date: Aug 2009
Location: The Central Coast of California
Device: K4NT, Galaxy Tab A, Kobo Aura2
Quote:
Originally Posted by Imperative View Post
Nope, nothing.

I've just noticed that I can't scroll FORWARD with the mouse wheel through the end of every html split. But I CAN scroll with the scroll bar anywhere! And I can scroll BACKWARDS with the mouse wheel through any split of the text. This limitation is quite strange.
You can't scroll thru in Paged Mode, BUT Spacebar does
theducks is offline   Reply With Quote
Old 10-09-2019, 08:25 PM   #12
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 35,332
Karma: 12711906
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You dont set margins on body, you set margins in the viewer settings. Similaraly you dont set colors on body you set it in the viewer settings. Similarly setting text-indent and text-align on body is fairly useless since they will almost certainly be overridden by styles for p for div tags.

And you haven't told us what version of calibre this is.
kovidgoyal is offline   Reply With Quote
Old 10-09-2019, 09:23 PM   #13
Imperative
Junior Member
Imperative began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2019
Device: Kobo Glo
Quote:
Originally Posted by kovidgoyal View Post
You dont set margins on body, you set margins in the viewer settings. Similaraly you dont set colors on body you set it in the viewer settings.
But that's exactly what I did, I set it all in the viewer=>preferences=>style. The version is 4.10, I've mentioned this in the second message.
Quote:
Originally Posted by kovidgoyal View Post
Similarly setting text-indent and text-align on body is fairly useless since they will almost certainly be overridden by styles for p for div tags.
Being very new here I honestly have no clue about what p and div tags stand for... I am at a loss actually, I know the program is beautifully designed and works properly, but I can't get what's wrong with my whole setting. I think tomorrow I am going to try to make it work on another laptop(s).
Imperative is offline   Reply With Quote
Old 10-09-2019, 09:50 PM   #14
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 35,332
Karma: 12711906
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No viewer->preferences->Paged layout
kovidgoyal is offline   Reply With Quote
Old 10-11-2019, 01:53 AM   #15
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,744
Karma: 13743230
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by Imperative View Post
Hello guys, I’ve got in real trouble while using a very primitive CSS in viewer:
Code:
body {
color: rgb(0,0,0)  !important;
background-color: rgb(228,226,224) !important;
line-height: 1 !important;
text-indent: 2em !important;
text-align: justify !important;
margin-top: 0px !important;
margin-bottom: 4px  !important;
margin-right: 10px !important;
margin-left: 50px !important;
font-family: Bookman Old Style !important;
font-size: 19px !important;
 }
There is no reason to use the style section in the viewer to set any of the following since they have sections in the viewer preferences to set these items:

FYI setting color and background color schemes is currently broken and will be fixed in the next release.

color
background-color
margin-top
margin-bottom
margin-right
margin-left
font-family
font-size

Just set the above in the sections dedicated to these items in the viewer preferences area not in the styles section.

If you insist on using line-height, text-indent, and text-align. They don't seem to work from the body level.

Instead use them as follows in the p and div levels.

Code:
p {
line-height: 1 !important;
text-indent: 2em !important;
text-align: justify !important;
}

div {
line-height: 1 !important;
text-indent: 2em !important;
text-align: justify !important;
}

Last edited by DoctorOhh; 10-11-2019 at 01:55 AM.
DoctorOhh 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
html to pdf, TOC Page# trouble from CSS... MrBen Conversion 5 11-19-2014 07:29 AM
Calibre: eBook Viewer - CSS Bug navjot001 Library Management 1 03-25-2014 08:55 AM
PRS-950 replacement css in prs+ book viewer setting - which properties are supported? gsgleason Sony Reader 3 12-16-2011 12:51 AM
CSS not applying correctly in E-Book Viewer. therealdrag0 Calibre 6 10-20-2011 11:19 AM
# user css for viewer.py/ ebook-viewer/ prs-650 tscamera Calibre 0 01-02-2011 06:28 PM


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


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