06-20-2017, 08:56 AM | #1 |
Enthusiast
Posts: 30
Karma: 10
Join Date: Feb 2015
Location: UK
Device: kindle fire hd
|
Help with Chapter seperators (lines underneath chapter headings)
Hi,
I can't figure out how to create bold lines beneath chapter headings. I've spotted many kindlebooks that make use of these, but I have no idea how they do it! I am able to use a simple underscore and run it along the page, but even when this is (h1 size) it doesn't look that bold. I've spotted books that use fancy lines too. If anyone can help me with this, it would be much appreciated. Thanks! Sarah. |
06-20-2017, 09:17 AM | #2 |
Resident Curmudgeon
Posts: 76,465
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
A lot of times, those fancy lines are just graphic images.
|
Advert | |
|
06-20-2017, 09:33 AM | #3 |
Grand Sorcerer
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Horizontal rule (an hr tag) is probably what you're looking for (if you don't want to use a graphic). You can size it and style it how you like.
|
06-20-2017, 09:53 AM | #4 |
Obsessively Dedicated...
Posts: 3,200
Karma: 34978132
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
|
Try using <hr /> (horizontal rule) for simple straight lines.
You can style it in the CSS stylesheet to be any thickness you like, or a double line, etc, etc. In the stylesheet, something like: Code:
hr {border-top: 1pt solid; margin-top: .5em; margin-bottom: .5em} Code:
hr {border-top: 4pt double; margin-top: .5em; margin-bottom: .5em} The greater the number of "points" (1pt, 4pt, 10pt), the thicker the line. Then in the HTML, you could put something like this: Code:
<h2>CHAPTER ONE</h2> <hr /> for instance, a quick "try it yourself" tutorial on horizontal rules can be found here: https://www.w3schools.com/tags/tryit...hr_default_css And JSWolf is correct in pointing out that the fancy swirly decorated lines are usually pictures. |
06-20-2017, 09:55 AM | #5 |
Obsessively Dedicated...
Posts: 3,200
Karma: 34978132
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
|
Dang. DiapDealer posted while I was shooting screens.
|
Advert | |
|
06-20-2017, 10:51 AM | #6 |
Grand Sorcerer
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
06-20-2017, 10:54 AM | #7 |
Enthusiast
Posts: 30
Karma: 10
Join Date: Feb 2015
Location: UK
Device: kindle fire hd
|
Thanks everyone for your advice! This is much appreciated!
Sarah |
06-20-2017, 11:01 PM | #8 |
Well trained by Cats
Posts: 30,451
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
and if you use the "Border" method.
Padding (same place) moves the line away from the text Do look at the treatise on the "box Model" |
06-21-2017, 04:46 PM | #9 |
Wizard
Posts: 1,610
Karma: 8399999
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
There are many ways to get what you want. Beside the previous answers, you can use something like the following:
1. In your .xhtml file Code:
<h1>Title 1</h1> <p class="border1"> </p> <h1>Title 2</h1> <p class="border2"> </p> Code:
h1 { text-align: center; margin: 1em 0 0; } .border1 { height: 2px; border-top: 2px solid black; border-bottom: 2px solid black; margin: 0 25% 1em; width: 50%; } .border2 { height: 2px; background: black; margin: 0 25% 1em; width: 50%; } Of course, you can change everything in the "border1" and "border2" classes (top margin, bottom margin, height (thickness of the line), background color, type of borders, border color, width of the lines, etc., etc.) Regards Rubén |
06-23-2017, 07:01 AM | #10 |
Enthusiast
Posts: 30
Karma: 10
Join Date: Feb 2015
Location: UK
Device: kindle fire hd
|
Thanks 'the ducks' and 'RbnJrg' for the extra tips.
Much appreciated! Sarah |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Invisible chapter headings? | bcamp47 | Sigil | 6 | 03-24-2013 01:38 AM |
How to mark chapter headings | JimLL | Sigil | 107 | 06-17-2012 10:02 AM |
Calibre: Chapter Headings | Paxman53 | Introduce Yourself | 5 | 10-22-2011 10:13 AM |
Chapter Headings | Paxman53 | Conversion | 3 | 10-12-2011 01:31 PM |
Why H1 and H2 Chapter Headings? | Ransom | Calibre | 11 | 08-10-2011 05:29 PM |