Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 02-17-2011, 02:56 PM   #46
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
Quote:
Originally Posted by cybmole View Post
but I have already observed and posted that extra css is honored expect for where it's contradicted within a style sheet ???

I will now test with an epub to epub conversion

1. I take an epub which has had indents removed by an added text-indent: 0 within the calibre2 style

2. i convert epub to epub using p { text-indent: 1em} in extra CSS

3 I view the output and see no indents.

so, as I thought, this is nothing to do with epub to mobi, there's a bug/feature which means the extra css line is not being applied when it is contradicted explicitly in the stylesheet.

so - bug or feature ???
Feature, That is why it is called Cascading Stylesheets. There is a particular cascade rule that tells which one gets used. Generally the more restricted rule is applied over the more general rule thus a style on a page overrides a style in the CSS file for example. Changing the order of entries changes the cascade if they are otherwise the same. You can also add !important to an entry to make it get preferences.

Dale
DaleDe is offline   Reply With Quote
Old 02-17-2011, 03:05 PM   #47
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
ok , I get that now, thanks

- so what needs to go in extra-css for override to work. - where does !important go

also, new example -
I thought styles applied left to right, thus in this code ( which is a chapter 1st line), calibre5 overrides calibre2
Code:
<p class="calibre2"><strong class="calibre5">Wrapped in</strong> wool blankets
now calibre2 has indent 1em, & calibre5 is only used at start of chapter, so I figure that simply adding indent 0 to calibre5 will cause this 1st sentences of chapters to NOT indent - yet it does not work - how come?

here's the definitions, incl the addition to calibre 5:
.calibre2 {
display: block;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
margin-top: 1em;
text-indent: 1em
}

.calibre5 {
font-weight: bolder;
text-indent: 0
}
cybmole is offline   Reply With Quote
Advert
Old 02-17-2011, 03:18 PM   #48
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
The caliber5's text-indent won't get used because it's not in the <p> tag.
Try
<p class="calibre2 calibre5"><strong>Wrapped in</strong> wool blankets

(you might want to remove the font-weight from the calibre5 definition.)
Perkin is offline   Reply With Quote
Old 02-17-2011, 03:20 PM   #49
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
For example: margin-right: 0px !important;
DaleDe is offline   Reply With Quote
Old 02-18-2011, 12:49 AM   #50
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by Perkin View Post
The caliber5's text-indent won't get used because it's not in the <p> tag.
Try
<p class="calibre2 calibre5"><strong>Wrapped in</strong> wool blankets

(you might want to remove the font-weight from the calibre5 definition.)
I see - subtle but logical- thanks
cybmole is offline   Reply With Quote
Advert
Old 02-18-2011, 12:58 AM   #51
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by DaleDe View Post
For example: margin-right: 0px !important;
thanks - but I'm still stuck :-(

is this valid extra css syntax ?
p {margin-top: 0.3em ; margin-bottom: 0.3em !important}

I am trying it on epub to epub where the book was previously converted with remove blank lines option ticked. I have unticked remove blank lines now but the extra CSS is not working - tried both with & without the !important tag.

it will work if I add it to the stylesheet, but I am seeking a bulk convert solution from within calibre here
cybmole is offline   Reply With Quote
Old 02-18-2011, 02:08 AM   #52
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by cybmole View Post
thanks - but I'm still stuck :-(

is this valid extra css syntax ?
p {margin-top: 0.3em ; margin-bottom: 0.3em !important}

I am trying it on epub to epub where the book was previously converted with remove blank lines option ticked. I have unticked remove blank lines now but the extra CSS is not working - tried both with & without the !important tag.

it will work if I add it to the stylesheet, but I am seeking a bulk convert solution from within calibre here
You are missing the ;. It should be:
p {margin-top: 0.3em ; margin-bottom: 0.3em !important ;}
Toxaris is offline   Reply With Quote
Old 02-18-2011, 02:18 AM   #53
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by Toxaris View Post
You are missing the ;. It should be:
p {margin-top: 0.3em ; margin-bottom: 0.3em !important ;}
i thought I'd tried that. have been running various ; placement permutations on a single book test conversion but hang on...

no joy

i used this exact phrase ( copy n paste to here)

p {margin-top: 0.3em ; margin-bottom: 0.3em; !important; }

but for info anyway, why is the trailing ; significant

I'd really like to apply this to 300+ books & not to have to edit 300+ stylesheets individually !

to reproduce the problem , for more testing.
1, pick a book, any book
2, convert to epub with remove blank lines ticked.
3. now try to convert the output from 2. + add a line spacing setting via extra css.

Last edited by cybmole; 02-18-2011 at 02:21 AM.
cybmole is offline   Reply With Quote
Old 02-18-2011, 03:56 AM   #54
DMSmillie
Enquiring Mind
DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'
 
DMSmillie's Avatar
 
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
Quote:
Originally Posted by cybmole View Post
i used this exact phrase ( copy n paste to here)

p {margin-top: 0.3em ; margin-bottom: 0.3em; !important; }

but for info anyway, why is the trailing ; significant
Ummm... actually, it isn't. The semicolon is needed between CSS properties, but isn't required on the last one since that is "closed" by the closing curly bracket. Though it isn't wrong to put a semicolon there - simply not required.
DMSmillie is offline   Reply With Quote
Old 02-18-2011, 04:33 AM   #55
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
As far as I know, the "!important" modifier must be specified per property. So, if you want both margins to be high priority, you should use:

Code:
p { margin-top: 0.3em !important ; margin-bottom: 0.3em !important }
or, if you want no side margins, this is shorter:

Code:
p { margin: 0.3em 0 !important }
(When you use "margin" with two values, the first value applies to top and bottom margins, the second value applies to left and right margins. When a value is 0 you don't have to specify the units.)
Jellby is offline   Reply With Quote
Old 02-18-2011, 05:07 AM   #56
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by Jellby View Post
As far as I know, the "!important" modifier must be specified per property. So, if you want both margins to be high priority, you should use:

Code:
p { margin-top: 0.3em !important ; margin-bottom: 0.3em !important }
or, if you want no side margins, this is shorter:

Code:
p { margin: 0.3em 0 !important }
(When you use "margin" with two values, the first value applies to top and bottom margins, the second value applies to left and right margins. When a value is 0 you don't have to specify the units.)
thanks, but been there tried that - i tried only specifying margin bottom- like this:
p {margin-bottom: 0.3em; !important;}

it did not work. I see no space between lines in output

seems that tinkering with the syntax is not addressing root issue that calibre extra-css will not override some explicit stylesheet values, even though it's supposed to ?

& I can;t think an alternative batch approach. it would to be something like explode the epub, edit the styesheet.css with find/replace commends in notepad++, (find all margin-top: 0 replace all with margin-top: 0.3em )then reassemble the epub.
I can do that manually at the keyboard but have not idea how to build a working batch process equivalent.
cybmole is offline   Reply With Quote
Old 02-18-2011, 06:28 AM   #57
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by cybmole View Post
thanks, but been there tried that - i tried only specifying margin bottom- like this:
p {margin-bottom: 0.3em; !important;}
There shouldn't be a semicolon between "0.3em" and "!important". I don't know if that would fix your problem, though.
Jellby is offline   Reply With Quote
Old 02-18-2011, 06:44 AM   #58
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
ok - I will try this
p {margin-top: 0.3em !important; }
and this
p {margin-top: 0.3em !important }

no joy with either
cybmole is offline   Reply With Quote
Old 02-18-2011, 07:29 AM   #59
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Could you post the following parts of your xhtml file:
- the part where the external stylesheets are specified
- the additional internal styles in the document
- the external stylesheets used.

I have the feeling that you have a problem with cascading and that your settings are overruled.
Toxaris is offline   Reply With Quote
Old 02-18-2011, 07:59 AM   #60
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
sure I though I'd done that earlier. I'll just open a test book...
here's a slice of xhtml
Code:
<style type="text/css">
@page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; }
</style>
</head>

<body class="calibre5">
  <div class="calibre6">
    <h1 class="calibre11" id="calibre_pb_21"><span class="calibre12">ten</span></h1>

    <div class="calibre13"></div>

    <p class="calibre10"></p>

    <p class="calibre10"><span class="calibre14"><span>It took me a</span> few seconds when I woke up to remember I was in the Soul Identity guesthouse. Val and I had climbed down the hill and returned to the office, where she wasted a few hours giving me demonstrations of her new online applications.</span></p>

    <p class="calibre10"><span class="calibre14">I laughed out loud when I remembered how disappointed I was to go back to work. But I had earned my round-the-clock pay, even if I did have a hard time staying focused on the software.</span></p>
& here's the style sheet stuff
.calibre {
display: block;
font-size: 1em;
line-height: 1.2;
margin-bottom: 0;
margin-left: 0;
margin-right: 5pt;
margin-top: 0;
padding-left: 0;
padding-right: 0;
page-break-before: always
}
.calibre1 {
display: table-row;
vertical-align: middle
}
.calibre10 {
border-bottom: 0;
border-top: 0;
display: block;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
margin-top: 0;
padding-bottom: 0;
padding-top: 0;
text-align: justify;
text-indent: 1em
}
.calibre11 {
display: block;
font-size: 1.25em;
font-weight: bold;
line-height: 1.2;
margin-bottom: 0.67em;
margin-left: 0;
margin-right: 0;
margin-top: 0;
page-break-before: always;
text-align: center
}
.calibre12 {
color: windowtext;
font-size: 0.9em;
font-weight: bold;
line-height: 1.2
}
.calibre13 {
border-bottom: 0;
border-top: 0;
display: block;
height: 4px;
margin-bottom: 0;
margin-top: 0;
padding-bottom: 0;
padding-top: 0;
text-indent: 1em
}


NB I figure you can reproduce this with ANY epub - maybe I put the formula in another thread -in 2 steps it is:
1. convert epub to epub with the option to remove blank lines set(ticked) in calibre.

2. then try to add add any kind of top / bottom margin via extra css

ps the above is a clean source. it is a kindle book that i own, converted to epub by calibre, not processed by any other program ( just viewed in Sigil)

Last edited by cybmole; 02-18-2011 at 08:27 AM.
cybmole is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Indents! Please Help! Ephraim Sigil 8 11-23-2010 03:43 PM
Margins and Indents sloecoach Calibre 2 09-26-2010 04:41 PM
Display of Hanging Indents crutledge Workshop 1 09-25-2009 06:09 PM
RFE: Remove remove tags in bulk edit magphil Calibre 0 08-11-2009 10:37 AM
Hanging indents? llasram Kindle Formats 11 01-05-2009 10:59 AM


All times are GMT -4. The time now is 11:33 AM.


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