Quote:
Originally Posted by speedyg
First of all, thanks much for Calibre. It's marvelous.
I'm trying to use the viewer function for the first time and my book (epub) is showing as double spaced. I've added the following to User Stylesheet:
body {
color: rgb(230,213,77) !important;
background-color:rgb(64,43,30) !important;
line-height: 1 !important;
text-align:justify;
margin-top:0px;
margin-bottom:4px;
margin-right:50px;
margin-left:50px;
text-indent:3em;
}
Everything except line-height seems to work fine. I've also tried defining line-spacing.
Nothing I do changes the line height or spacing. When I use the same code on w3schools.com CSS TryIt page it displays exactly as I'd expect.
Am I doing something wrong?
Thanks.
|
Given that a unitless line-height operates as a multiplier on the element's font size and you don't have a font size declaration visible, that might be an issue. You could try adding a font-size: 1em; declaration and see if that has any effect when you change the line-height though that 1em font size is relative to the parent element font-size declaration and if no parent element declaration, defaults to the renderer's default. It is better to use unitless line-heights in conjunction with font-size since using em and % for line heights can give interesting inheritance effects (for certain values of interesting...).
Another possibility is if there are any line height declaration on lower level elements. Take a close look at the classes used with <p> tags (or <div> tags for those ebook creators who insist on using <div> instead of <p> for paragraphs.)
You might also want to dump the absolute units for your margins and replace them with ems or other relative units. For instance, the right and left 50px margins on my old Kobo Touch would use 100 pixels of the 600 pixel screen width while on a KA1 with a 1404 pixel wide screen or Kobo Forma with a 1440 pixel wide screen, that 100 pixels is a lot smaller percentage of the screen width. Setting the left and right margins to 8.33% would give the same width on any of the three displays with the pixels ranging from 50 to 120.