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-2014, 07:35 AM   #1
Kol
Junior Member
Kol began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2014
Device: Kobo Touch
Header Spacing

Hi,
having some problems with header spacing. Entered the following code:

h2, h3, h4, h5 {
text-align: left;
margin-bottom: 0em;
margin-top: 2em;
}

If I alter the text-align (center, left, etc.), it changes my file
But the margins are unaffected whatever numbers I enter.

Am I doing something wrong!
Thanks
Kol is offline   Reply With Quote
Old 02-17-2014, 09:08 AM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,550
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
You can't get any top margin?

That usually happen immediately following a "soft" (meaning css page-break-(before|after)) page-break. Most devices/apps using Adobe's RMSDK ignores margin-top in those situations. I believe the ePub spec permits them to do so.

I've heard some say they could get around it using "padding-top" instead, but a sure-fire way to force the renderers to honor margin-top on a new "page" is to split the actual xhtml file and start a new one. Margin-top is always honored at the start of a new file.
DiapDealer is offline   Reply With Quote
Old 02-17-2014, 09:23 AM   #3
doubleshuffle
Unicycle Daredevil
doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.
 
doubleshuffle's Avatar
 
Posts: 13,923
Karma: 185041098
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
"padding-top" does work. I use it all the time with poetry, where you just can't have a new file for every single poem.
doubleshuffle is offline   Reply With Quote
Old 02-17-2014, 09:55 AM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,550
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Good to know. I've just never had reason to try it. I never really need/use soft page-breaks--except sometimes with footnotes, and then I don't care about margin-top.

I pretty-much live in the Novel World, but can easily understand how that sort of thing might be useful outside that environment.
DiapDealer is offline   Reply With Quote
Old 02-17-2014, 10:17 AM   #5
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: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Sometimes you cannot use padding (if you have a background or top border). In that case you can add a dummy element to create the pagebreak:

Code:
<p>Some text at the end of a page.</p>

<div class="pagebreak"/>

<h2>Title, with top margin retained</h2>
Then you just style div.pagebreak to be invisible (heigh: 0; margin: 0) and force a pagebreak (page-break-before: always). In some renderers you may have to add some content to the <div> (&nbsp;).
Jellby is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
missing header brinded ePub 2 07-04-2013 02:38 PM
Header problem mtravellerh Sigil 8 08-13-2009 06:20 PM
Changing the header VicLavigne Calibre 2 12-28-2008 10:46 AM
No Title Header in 0.4.91? nellow Calibre 14 12-15-2008 04:35 PM


All times are GMT -4. The time now is 09:17 AM.


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