02-05-2018, 04:45 PM | #1 |
Enthusiast
Posts: 30
Karma: 10
Join Date: Feb 2018
Device: PC
|
How to add a horizontal line under the header?
Hi!
I'm trying to add a horizontal line to the header, during conversion (to pdf). I tried everything I found and could think (<hr>, underline, bottom border)of but I can't get a line under the header. Only under the header text. This is my header: Code:
<div style="font-size:x-small;"><p style="float:left;">_TITLE_</p><p style="float:right;"><i>_SECTION_</i></p></div> Any ideas? Last edited by mzso; 02-06-2018 at 05:40 AM. Reason: Left out some stuff on the first try. |
02-05-2018, 04:57 PM | #2 | |
Well trained by Cats
Posts: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Where did you put the HR? or border? Code:
<div> (FWIW I don't style inline since I learned about CSS) |
|
Advert | |
|
02-05-2018, 05:22 PM | #3 | |
Enthusiast
Posts: 30
Karma: 10
Join Date: Feb 2018
Device: PC
|
Quote:
Everywhere... With the div it doesn't work. The border will always be at the top of the page. There's only an input line for this so no other possibility... |
|
02-05-2018, 07:07 PM | #4 |
Book E d i t o r
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
|
Did you try one of the following?
<hr width="100px"> or <hr width="50%"> (Change the numbers above to whatever you want...) I don't understand the difference in your question between the "header" and the "header text." |
02-05-2018, 07:20 PM | #5 | |
Enthusiast
Posts: 30
Karma: 10
Join Date: Feb 2018
Device: PC
|
Quote:
The difference would be that wether the line extends all the way through the width of the page (minus margins). |
|
Advert | |
|
02-05-2018, 08:12 PM | #6 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Maybe I'm totally misunderstanding the problem, but doesn't a plain, simple <hr/> tag display a 100%-width line?
|
02-05-2018, 08:27 PM | #7 |
Resident Curmudgeon
Posts: 73,998
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Where did you get that really really horrible code?
|
02-05-2018, 09:41 PM | #8 | |
Well trained by Cats
Posts: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
<hr /> fills the space between margins of the current block And I agrre with the Wolf. Pretty poor coding practice |
|
02-06-2018, 04:13 AM | #9 |
Enthusiast
Posts: 30
Karma: 10
Join Date: Feb 2018
Device: PC
|
From the documentation, linked from within the program.
Feel free to suggest something better. Not in this case it seems. But feel free to combine <hr> with the code I have in a way that works. (Or present an analogous one, which works with <hr>) Last edited by mzso; 02-06-2018 at 04:31 AM. |
02-06-2018, 04:17 AM | #10 | |
Enthusiast
Posts: 30
Karma: 10
Join Date: Feb 2018
Device: PC
|
Quote:
You can agree all you want. It's a scarcely modified version of the example in the documentation. (I changed the field to be show.) Last edited by mzso; 02-06-2018 at 04:28 AM. |
|
02-06-2018, 04:54 AM | #11 |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
This is not a Calibre question. Moved to the ePub forum.
|
02-06-2018, 05:38 AM | #12 | |
Resident Curmudgeon
Posts: 73,998
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
CSS Code: Code:
body { widows: 1; orphans: 1; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; text-align: justify; } h2 { margin-top: 0.8em; margin-bottom: 0; text-align: center; } hr { border-top: 2px solid; margin-bottom: 1em; } p { margin-top: 0; margin-bottom: 0; text-indent: 1.2em; } .noindent { text-indent: 0; } Code:
<?xml version="1.0" encoding="utf-8"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"> <head> <title>Dark in Death</title> <link href="../styles/stylesheet.css" rel="stylesheet" type="text/css"/> </head> <body> <h2>TITLE</h2> <hr/> <p class="noindent">This is the first paragraph</p> <p>This is the second paragraph</p> </body> </html> |
|
02-06-2018, 05:43 AM | #13 |
Enthusiast
Posts: 30
Karma: 10
Join Date: Feb 2018
Device: PC
|
This is definitely not an epub question. It was in the conversion section for a reason. I have this issue when I try to convert to PDF. With Calibre of course.
(Though I concede that I neglected to mention this info in the OP) |
02-06-2018, 05:44 AM | #14 |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
It's a book coding question, though, not a conversion question.
|
02-06-2018, 05:47 AM | #15 | |
Enthusiast
Posts: 30
Karma: 10
Join Date: Feb 2018
Device: PC
|
Quote:
There's only a simple one line "header template" input field, for headers in the pdf output section, which I was talking about. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
horizontal line on screen of Kobo Aura One | sbin | Kobo Reader | 10 | 10-31-2016 08:47 AM |
Horizontal line running through Nook HD+ Screen | LornaH75 | Nook Color & Nook Tablet | 1 | 07-22-2013 07:53 PM |
special characters e & i with horizontal line above | cybmole | Sigil | 22 | 04-17-2013 11:00 AM |
PRS-600 Horizontal line at start of chapter | Gernella | Sony Reader | 0 | 01-03-2010 10:28 AM |
Horizontal white line | DrMoze | Sony Reader | 5 | 01-14-2008 10:57 AM |