Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 08-20-2012, 03:57 PM   #1
Kittybriton
Member
Kittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchfork
 
Kittybriton's Avatar
 
Posts: 15
Karma: 48138
Join Date: Aug 2012
Device: FBReader, Cool Reader and Aldiko (Android Tablet)
What dark art is this?

Fortunately for me, I have a brother who studied engineering, and he introduced me to the idea of a cascade error - something unobtrusive that causes unexpected behavior of code which is very difficult to trace, because it affects things that it is seemingly not directly related to.

CSS seems like something of a dark art to me: after figuring out the complexities of embedding a font (largely thanks to posts here), redefining the H1 entity (defined after the body entity in a single style sheet, as copied below) caused the body to add the same amount of line space as the H1. The line-height: 100%; was added to the body definition to correct this effect, but I don't understand why it should have been necessary.

Does this make sense to anybody

Code:
body {font-family:"Palatino Linotype", Georgia, serif; 
	text-align: justify; 
	line-height:100%;
	}

h1 {font-family: "Palatino Linotype", serif; 
    font-weight: normal; 
    font-style: italic;
    font-weight: bold;
    color: rgb(24, 136, 173);
	text-align: center;
	line-height: 110%;
    }
Kittybriton is offline   Reply With Quote
Old 08-20-2012, 06:44 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,897
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 Kittybriton View Post
Code:
body {font-family:"Palatino Linotype", Georgia, serif; 
	text-align: justify; 
	line-height:100%;
	}

h1 {font-family: "Palatino Linotype", serif; 
    font-weight: normal; 
    font-style: italic;
    font-weight: bold;
    color: rgb(24, 136, 173);
	text-align: center;
	line-height: 110%;
    }
Code:
body {
font-family:"Palatino Linotype", Georgia, serif; 
text-align: justify;
margin-top: 0;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
widows: 0;
orphans: 0
}

h1 {
margin-top: 1em;
margin-bottom: 1em;
font-style: italic;
color: rgb(24, 136, 173);
text-align: center;
}
I've changed the code as you can see. You left out margins for the header for the chapter. Also you've left out the margins in the body style. But to be honest, I personally prefer h2 for chapter headers. Also, unless you are changing the font, you don't need to have the font-family line that you have in body as that is now the default unless another style overrides that. The widows and orphans being 0 is a personal choice based on the ends of the screen page not being constant.
JSWolf is offline   Reply With Quote
Advert
Old 08-21-2012, 05:05 AM   #3
SBT
Fanatic
SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.
 
SBT's Avatar
 
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
@Kittybriton: Just checked it in Chrome browser window; I suppose you have noticed that default line height isn't necessarily 100% (in my case more?)
SBT is offline   Reply With Quote
Old 08-21-2012, 06:59 AM   #4
Kittybriton
Member
Kittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchfork
 
Kittybriton's Avatar
 
Posts: 15
Karma: 48138
Join Date: Aug 2012
Device: FBReader, Cool Reader and Aldiko (Android Tablet)
Thanks JSWolf. Since Sigil likes to take care of errors itself (and I wasn't at my best after two very early starts), it may be that I wasn't careful about checking for changes that had been inserted automatically.

Yes, SBT, that is exactly what puzzled me when I checked it in Sigil and the Firefox ePub Reader plugin. What I still don't understand is why the line-height changed without me specifying anything that, as far as I can see, related to line-height.

Before I started specifying the font, the line-spacing was unchanged. My first attempt, with the header definition before body, worked to select Palatino for the header, but was ignored in the body. I have a vague recollection from way back that when I glanced at the w3 consortium specs, they said something about precedence when defining entities, but at the time didn't take note of it.

[postscript] Upon checking the XML code, I find that Sigil had decided the first paragraph should be in the h2 entity, rather than p. Corrected that, and the sun shines once more

There are other questions I will need to answer if I am to decide whether to commit the time and energy necessary to learning the ePub format in depth, so another thread will probably be forthcoming.

Looking for a quick answer rather than being diligent and Googling, can anyone tell me, does the ePub format support the use of Javascript?

Found a satisfactory answer pro tem, i.e. possibly in more advanced versions, but best avoided.

Last edited by Kittybriton; 08-21-2012 at 07:23 AM. Reason: addendum and corrigenda
Kittybriton is offline   Reply With Quote
Old 08-21-2012, 07:20 AM   #5
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
Checking things in Sigil and Firefox may not be sufficient. You might check it in your device as well, because the rendering engines for Sigil and Firefox can vary from your device and other different devices.
mrmikel is offline   Reply With Quote
Advert
Old 08-21-2012, 07:23 AM   #6
Kittybriton
Member
Kittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchforkKittybriton can load mercury with a pitchfork
 
Kittybriton's Avatar
 
Posts: 15
Karma: 48138
Join Date: Aug 2012
Device: FBReader, Cool Reader and Aldiko (Android Tablet)
Thanks Mrmikel, yes, I am trying to check the output in as many devices as I can beg or borrow, knowing that not all readers are created equal.
Kittybriton is offline   Reply With Quote
Reply

Tags
css


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Free online read (urban fantasy) from Pocket After Dark - Surrender the Dark Susan Crealock Deals and Resources (No Self-Promotion or Affiliate Links) 2 12-12-2014 08:33 PM
Google Art Hamlet53 Lounge 1 05-28-2011 08:10 PM
Free online read (paranormal romance) from Pocket After Dark - Dark Protector Susan Crealock Deals and Resources (No Self-Promotion or Affiliate Links) 0 05-15-2011 01:10 AM
Art For Cover genepool Writers' Corner 4 01-28-2011 09:44 PM
Unutterably Silly Art de Forums Godzil Lounge français 16 06-11-2010 11:31 AM


All times are GMT -4. The time now is 07:28 PM.


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