View Single Post
Old 09-14-2014, 12:41 AM   #1
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 681
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
wacky reused "sgc" styles

I'm looking at tidying up the code on a ePub and find that each (of 80) xhtml file has its own style definitions. So I wanted to start by extracting these and putting them all in the common stylesheet.css file.

Then I found they reuse the same style names with different definitions :

e.g.:
Code:
<style type="text/css">
p.sgc-2 {font-style: italic}
a.sgc-1 {font-weight: bold}
</style>
and
Code:
<style type="text/css">
p.sgc-2 {font-weight: bold}
a.sgc-1 {font-weight: bold}
</style>
All the styles have "sgc" in their name. Anyone know where they come from?

Merging two of these files in Sigil, it doesn't notice the conflict and the sgc-2 bold in the second file is now italic.

Obviously global S&R will just scramble these up. Is there any way short of editing each file individually to rationalise the styles, to e.g.
Code:
p.italic {font-style: italic}
p.bold {font-weight: bold}
which I can then put in the global css?

(I'd rather just use <b> and <i> myself, but that would be too simple.)

Last edited by AlanHK; 09-14-2014 at 12:44 AM.
AlanHK is offline   Reply With Quote