![]() |
#1 |
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Jun 2013
Device: Kindle 4
|
Line over text
Hello
I'm new to Sigil and I have a problem I was hoping someone who have an answer to. I'm trying to create a line over a sub chapter heading but when I used the overline in text-decoration, the line is too close to the text and I don't know how to increase the distance between the text and the line. I have also tried to use the border option but I don't know how to stop the border from going over the entire page width but only where the text is. Hope it makes sense |
![]() |
![]() |
![]() |
#2 |
Color me gone
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
How about a horizontal rule? <hr /> The following is borrowed from another post:
You need to set the margin to half the width of space left over by the horizontal rule. Eg, if you want a rule that's 70% of the page width, that leaves 30% remaining, so you'd set the left margin to half of that space, or 15%: CSS Code: hr { width: 70%; margin-left: 15% } |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 878
Karma: 2457540
Join Date: Nov 2011
Device: none
|
You will become a great deal happier when you re-define your task from 'reproducing the printed layout' to 'presenting the text in an ebook-appropriate manner'.
|
![]() |
![]() |
![]() |
#4 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Maybe increasing "line-height" has the effect you are looking for.
|
![]() |
![]() |
![]() |
#5 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,634
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Code:
h2 { display: table; /*the key in order to get the top-line*/ font-size: 1.4em; padding-top: 0.4em; /*here you control the gap between the text and the top-line*/ margin: -0.35em auto 2em; /*the complement of the key*/ border-top: 2px solid black; } p { font-size: 1em; text-align: justify; text-indent: 0; } p + p { text-indent: 1em; } .center { text-align: center; } .bold { font-weight: bold; } Code:
<body> <p class="center bold">CHAPTER 1</p> <h2>BLA BLA BLA BLA BLA</h2> <p>...</p> <p>...</p> ... </body> ![]() Also you can use, alternatively, the following styles: Code:
p { font-size: 1em; text-align: justify; text-indent: 0; } p + p { text-indent: 1em; } .top_line { display: table; /*the key in order to get the top-line*/ font-size: 1.4em; font-weight: bold; text-indent: 0; padding-top: 0.4em; /*here you control the gap between the text and the top-line*/ margin: -0.35em auto 2em; /*the complement of the key*/ border-top: 2px solid black; } .center { text-align: center; } .bold { font-weight: bold; } Code:
<body> <p class="center bold">CHAPTER 1</p> <p class="top_line">BLA BLA BLA BLA BLA</p> <p>...</p> <p>...</p> ... </body> Regards Rubιn Last edited by RbnJrg; 06-09-2013 at 10:26 AM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,891
Karma: 59840954
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
I was going to suggest the border-top solution of RbnJrg
Use border Top if the line is only wanted if there is a sub title Use a border-bottom (on the chapter title) if it is always wanted. Padding-top (or bottom) sets the white space between the line and parent text |
![]() |
![]() |
![]() |
#7 |
Connoisseur
![]() Posts: 57
Karma: 10
Join Date: Dec 2011
Device: Samsung Tablet
|
What about if you want the line beside the heading like this?
I'd like a better way to do this as it doesn't allow for changes in the size of the chapter heading text, and I'd like it to start on the right then finish at the header. Code:
<h2>BLA BLA BLA BLA BLA</h2> <div class="ruleclass"> <hr /> </div> Code:
.ruleclass { margin-left: 1em; margin-right: 1em; margin-top: -4em; } hr { height: 3px; background:#505050; width: 40%; } |
![]() |
![]() |
![]() |
#8 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,634
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Code:
h2 { font-size: 1.4em; text-align: left; margin: 1em 0; white-space: nowrap; } h2:after { display: inline; font-size: 1.2em; text-overflow: clip; white-space: nowrap; word-spacing: -10px; content:" ————————————————————————————————————————————————————————————"; } And in your .html file write: Code:
<h2>BLA BLA BLA BLA</h2> <p>.... something ...</p> Regards Rubιn Last edited by RbnJrg; 06-09-2013 at 06:42 PM. |
|
![]() |
![]() |
![]() |
#9 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,891
Karma: 59840954
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
![]() |
![]() |
![]() |
#10 | |
Connoisseur
![]() Posts: 57
Karma: 10
Join Date: Dec 2011
Device: Samsung Tablet
|
Quote:
The good thing is it works on chapter One and on Twenty-Three just as well and the lines don't flow through to the next line. ![]() I added a font-size: to the h2:after to reduce the thickness of the em dashes. |
|
![]() |
![]() |
![]() |
#11 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,018
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
This has nothing to do with Sigil. This is an ePub issue. Please some moderator move the thread. Thanks.
We get too many threads in here that have nothing to do with Sigil. |
![]() |
![]() |
![]() |
#12 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,891
Karma: 59840954
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Agreed
Moderator Notice
Moved |
![]() |
![]() |
![]() |
#13 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
|
![]() |
![]() |
![]() |
#14 |
Connoisseur
![]() Posts: 57
Karma: 10
Join Date: Dec 2011
Device: Samsung Tablet
|
That seems the be the issue, I'm thinking of adding a extra loooong dash to my on dinkus font I've created. I'll make it about 30 em dashes long and see how it goes. Then I can embed the font.
|
![]() |
![]() |
![]() |
#15 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,634
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Code:
content:" "; Code:
content:" _____________________________________________________________"; |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Images always show on new page, even if there's only 1 line of text on previous pg | SarahMB | ePub | 13 | 01-19-2013 04:37 PM |
Since 1.9.10, text slightly cut off on very bottom line | danskmacabre | Kobo Reader | 33 | 01-13-2012 05:25 AM |
Two columns of text, line down middle? | chingu | ePub | 2 | 09-04-2011 06:12 PM |
Text file formatting - line feeds and spaces | Fallingwater | Workshop | 6 | 07-04-2011 02:42 PM |
changing text line-height in css | wjcroft | EPUBReader | 0 | 12-15-2010 03:13 PM |