10-24-2017, 05:04 PM | #1 |
Junior Member
Posts: 3
Karma: 10
Join Date: Oct 2017
Device: none
|
Sigil Nav.xhtml Line Break Issue
In my ebook nav.xhtml, below is the code I'm dealing with. I would like to have a blank space between the Preface and Part One of the book. However, any code I try to add to create a blank space or line (such as <br/>)does not work. I keep getting a parsing error. Should I pursue creating a different line class in my style sheet? Can anyone help? Thanks, Dave
<h1>CONTENTS</h1> <ol> <li> <a href="../Text/Section0008.xhtml#preface">Preface (Adam Davis)</a> </li> <li> <a href="../Text/Section0009.xhtml#one_part">ONE: BEYOND THE IMAGE</a> </li> Last edited by Dave_M; 10-24-2017 at 05:06 PM. Reason: clarity |
10-24-2017, 05:07 PM | #2 |
A Hairy Wizard
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Use CSS to set the formatting:
li {margin-top:2em} You should have a css stylesheet (something like "stylesheet.css") where you can put the code above. Then link that sheet be right-clicking on your html file(s) and selecting "link stylesheet". Point it to your stylesheet and...voila! edit: OH! And Welcome to MR!! Last edited by Turtle91; 10-24-2017 at 05:10 PM. |
Advert | |
|
10-24-2017, 05:21 PM | #3 |
Junior Member
Posts: 3
Karma: 10
Join Date: Oct 2017
Device: none
|
Hi. Thank you! This is my first post. Er, that was.
Well, I tried that early on. But the issue is that I want extra space only in three places: between Part I, Part II, and Part III in the table of contents in the nav.xhtml file. I need to add a blank space between those three lines. In other words, I don't want to add extra white space between every entry in the contents. Does that make sense? Last edited by Dave_M; 10-24-2017 at 05:22 PM. Reason: clarity |
10-24-2017, 08:46 PM | #4 |
A Hairy Wizard
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Then you give those special cases a class name:
Code:
CSS li.space {margin-top:2em} HTML <li class="space">Part I</li> <li>One</li> <li>Two</li> <li>Three</li> <li class="space">Part II</li> <li>Four</li> <li>Five</li> <li>Six</li> <li class="space">Part III</li> <li>Seven</li> <li>Eight</li> <li>Nine</li> You can even go crazy and give them 'spiffy' formatting just by changing the CSS like this: Code:
li {text-indent:2em} li.space {margin-top:2em; text-indent:0; font-weight:bold; color:blue; text-decoration:underline; font-size:1.5em} Cheers! Last edited by Turtle91; 10-24-2017 at 09:00 PM. |
10-24-2017, 08:54 PM | #5 |
A Hairy Wizard
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
You can find a lot of information about how to style/format your ebooks on the MR Wiki, the ebook production page, and a great tutorial reference page on W3Schools.
|
Advert | |
|
10-25-2017, 01:35 PM | #6 |
Guru
Posts: 878
Karma: 2457540
Join Date: Nov 2011
Device: none
|
Or, just manually use
li style="margin-top:2em" instead of li for the few instances that require it. It's not 'best practice' but it works, and we all do it :-) |
10-25-2017, 03:20 PM | #7 | |
Guru
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
In Sigil, use the tool Table of Contents/Create HTML Table of Contents to make a page you can edit and format without consequence. Or copy the nav file to a normal xhtml file and format that if you want the list format. |
|
10-25-2017, 03:33 PM | #8 |
Sigil Developer
Posts: 7,630
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Actually the nav is epub3 but it can serve as both a machine-parsed html toc or a normal html toc depending on if you want it to be. I have seen nicely formatted navs used that are still machine readable and therefore able to replace the toc.ncx and html toc if needed nicely.
|
10-25-2017, 07:58 PM | #9 | |
A Hairy Wizard
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
It is better to learn the proper/easy/accepted way of doing it first...then they know when they are breaking the rules and why. |
|
10-26-2017, 10:47 AM | #10 |
Junior Member
Posts: 3
Karma: 10
Join Date: Oct 2017
Device: none
|
Thanks, everyone. And, Turtle, that fix worked!
I had tried before to do something similar, create a special class, but for some reason it didn't work (probably a naming issue on my part). Again, your code worked. Many thanks! Can't say enough. Dave ps. I didn't get spiffy. But in the future, I might just. |
10-26-2017, 07:03 PM | #11 | |
Bookmaker & Cat Slave
Posts: 11,460
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
I just wanted to say, I've had a really crap week. I was sick (over my damn weekend, of course) and this week has felt a million years long thus far. I really needed that laugh. Not that it's not absolutely true, mind you, but the laugh was perfect. TY for that. Hitch |
|
10-26-2017, 07:45 PM | #12 |
A Hairy Wizard
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Sorry for the awful week - but glad I could lighten it somewhat!
Glad to help Dave - Cheers! |
Tags |
nav, sigil, spacing |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
TOC nav.xhtml issue | ebookscovers | Conversion | 1 | 05-06-2017 11:12 AM |
ToC help needed: nav.xhtml | Phssthpok | Editor | 10 | 04-14-2017 04:58 AM |
I don’t want a page break between different xhtml files | Sergi | ePub | 3 | 09-16-2010 02:09 PM |
PDF 2 LRF, line break issue | ^_Pepe_^ | Calibre | 1 | 12-03-2009 06:43 AM |