Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Viewer

Notices

Reply
 
Thread Tools Search this Thread
Old 02-01-2021, 04:17 AM   #1
rockster
Connoisseur
rockster began at the beginning.
 
Posts: 52
Karma: 10
Join Date: Sep 2012
Device: kindle
How to increase line spacing in book viewer?

I tried this css code: line-spacing:3.0; but it doesn't seem to work.
rockster is offline   Reply With Quote
Old 02-01-2021, 04:20 AM   #2
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: 45,253
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Code:
* { line-height: 3 !important}
kovidgoyal is offline   Reply With Quote
Advert
Old 02-01-2021, 05:22 AM   #3
rockster
Connoisseur
rockster began at the beginning.
 
Posts: 52
Karma: 10
Join Date: Sep 2012
Device: kindle
Thanks, it worked.

If i want to add other css codes, do they have to be formated in the same way? For example, the code for justifying the text should it look like this:
Code:
* {text-align: justify !important}
rockster is offline   Reply With Quote
Old 02-01-2021, 05:49 AM   #4
chrisparker
Connoisseur
chrisparker can load mercury with a pitchforkchrisparker can load mercury with a pitchforkchrisparker can load mercury with a pitchforkchrisparker can load mercury with a pitchforkchrisparker can load mercury with a pitchforkchrisparker can load mercury with a pitchforkchrisparker can load mercury with a pitchforkchrisparker can load mercury with a pitchforkchrisparker can load mercury with a pitchforkchrisparker can load mercury with a pitchforkchrisparker can load mercury with a pitchfork
 
chrisparker's Avatar
 
Posts: 81
Karma: 48014
Join Date: May 2011
Location: London, UK
Device: iPad Air 4, iPad mini 5, Kobo Forma, Kobo Aura One, Nook ST Glowlight
FWIW, I remove all line-height CSS from my books because my wife and I read at different text sizes.
chrisparker is offline   Reply With Quote
Old 02-01-2021, 10:24 AM   #5
ShellShock
Wizard
ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.
 
ShellShock's Avatar
 
Posts: 1,178
Karma: 2431850
Join Date: Sep 2008
Device: IPad Mini 2 Retina
The "!important" property is quite a little attention-seeker - it says, "look at me, I am more important than anyone else!". In this case, the code:

Code:
* {text-align: justify !important}
says "ignore other text-align properties anywhere else, do as I say instead!"

You should be careful when using "!important"; if you put it into an epub to be read by other people, then they may not thank you for it as you just made it more difficult for them to change the text-alignment to their own preference.

Conversely, it may be the only way for you to override the text-alignment in an epub that you want to read.

In summary, I would only use "!important" if it does not work without it.
ShellShock is offline   Reply With Quote
Advert
Old 02-01-2021, 12:17 PM   #6
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,584
Karma: 14328510
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by rockster View Post
If i want to add other css codes, do they have to be formated in the same way? For example, the code for justifying the text should it look like this:
Code:
* {text-align: justify !important}
That would break the valid text-align:center and text-align:right and not just fix the ragged right stuff.
hobnail is offline   Reply With Quote
Old 02-01-2021, 12:52 PM   #7
rockster
Connoisseur
rockster began at the beginning.
 
Posts: 52
Karma: 10
Join Date: Sep 2012
Device: kindle
What the Asterisk sing in front mean? I am not very advanced in css coding.
rockster is offline   Reply With Quote
Old 02-01-2021, 03:16 PM   #8
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 45,398
Karma: 168808725
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by rockster View Post
What the Asterisk sing in front mean? I am not very advanced in css coding.
The asterisk is the universal selector so it applies to everything. You can take a look at What is the use of asterisk (*) selector in CSS ? for a more detailed explanation.

Last edited by DNSB; 02-01-2021 at 08:30 PM.
DNSB is offline   Reply With Quote
Old 02-01-2021, 05:24 PM   #9
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,584
Karma: 14328510
Join Date: Nov 2019
Device: none
The asterisk is a big sledge hammer with the !important putting it on steroids because authors and editors and people doing the formatting don't use cascading in their css.
hobnail is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
4.x Viewer Line Spacing? mwexler Calibre 9 03-30-2020 06:51 AM
How to Increase Line Space in Calibre 4.2 Viewer brown.ml Calibre 2 10-19-2019 11:07 AM
docx to mobi conversion: how to increase line spacing dsv Conversion 4 06-25-2019 11:02 PM
Pdf line spacing in Calibre Viewer sanon Library Management 4 04-20-2016 07:07 PM
Can't adjust line spacing in book bought from Kobo mumbletop Kobo Reader 1 11-06-2012 08:57 PM


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


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