|  02-17-2014, 07:35 AM | #1 | 
| Junior Member  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 | 
|   |   | 
|  02-17-2014, 09:08 AM | #2 | 
| Grand Sorcerer            Posts: 28,880 Karma: 207000000 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. | 
|   |   | 
| Advert | |
|  | 
|  02-17-2014, 09:23 AM | #3 | 
| Unicycle Daredevil            Posts: 13,944 Karma: 185432100 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.
		 | 
|   |   | 
|  02-17-2014, 09:55 AM | #4 | 
| Grand Sorcerer            Posts: 28,880 Karma: 207000000 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. | 
|   |   | 
|  02-17-2014, 10:17 AM | #5 | 
| frumious Bandersnatch            Posts: 7,570 Karma: 20150435 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> | 
|   |   | 
| Advert | |
|  | 
|  | 
| 
 | 
|  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 |