![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Question: Centered Heading With Line Through Middle
I was wondering if anyone has stumbled upon a way to do these headings in EPUB (Highlighted in orange):
The current EPUB uses images. (HIDEOUS solution, and does not scale at all): I found this, which would work on websites: http://www.impressivewebs.com/center...rizontal-line/ I found some similar discussion on the forums here for a line which is below by using a bottom-border (and code for line that fills all the way to the right edge): https://www.mobileread.com/forums/sho...d.php?t=215338 Seems like a lot of these use CSS3, or code that breaks in ADE. (This was going to be my simple solution) Just use a few em dashes to the left/right: Code:
<h2>——— I ———</h2> <h2>——— II ———</h2> [...] <h2>——— XIII ———</h2> Last edited by Tex2002ans; 02-11-2014 at 03:40 AM. |
![]() |
![]() |
![]() |
#2 |
eBook Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 85,544
Karma: 93383099
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
Could use a single-cell table with visible borders. I'd be wary of using paragraph borders, because that won't work with the old "Mobi" format on the Kindle, and most authors sell a lot more Kindle than ePub books.
Last edited by HarryT; 02-11-2014 at 03:25 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
I went back and edited my first post clarifying the exact position I meant by highlighting.
Not too sure how you would accomplish that with a single cell. (Perhaps you were talking about the "CHAPTER IV", and yes, that was handled with top/bottom borders via CSS, and I can see that being accomplished also with a table cell). Quote:
In this case, it doesn't really matter if this fluff in the EPUB doesn't appear in the old MOBI version, as long as it just degrades gracefully and works fine in ADE. The simple em dashes on either side would work just fine for my purposes (anything would be better than those images! ![]() ![]() Only downside I can see of the em dash method is one in which Jellby answered in one the topic linked above: |
|
![]() |
![]() |
![]() |
#4 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,711
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
You can achieve that effect with the following code: 1. In your .css stylesheet, write: Code:
h2 { text-align: center; margin: 1em 0 1em 0; font-size: 1.4em; border-top: 3px solid black; height: 0.5em; } .text { float: left; width: 5%; /* feel free to change the width */ margin: -0.5em 47.5% 0 47.5%; /* if you change the width, then you must change the left and right margin */ background: white !important; } p { text-align: justify; text-indent: 0em; } Code:
<h2><span class="text">I</span></h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac tellus nunc...</p> Below I attach the respective .epub Regards Rubén |
|
![]() |
![]() |
![]() |
#5 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,213
Karma: 34984682
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
|
@RbnJrg -- but won't that look odd if the user does not have Black Text on a White Background?
O, I wish CSS could use variables, life would be so much easier! @Tex -- if you want to go through the hassle of an embedded font, freeware Type Light [http://www.cr8software.net/typelight.html -- it says "open type font editor", but also works with true type] is fairly simple to use to edit/replace glyphs. You could make the emdash longer, and embed that subsetted font. Just a thought. Last edited by GrannyGrump; 02-11-2014 at 09:22 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,180
Karma: 8800000
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
|
Quote:
Please see this thread, Post #13-#21. Nook does not like condensed margins when not using publisher defaults. ![]() I will bookmark this post. ![]() bernie |
|
![]() |
![]() |
![]() |
#7 | |||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Of course! Right when I saw negative margins in your post, the same type of solution clicked for me (I hate it when that happens).
Thanks for the fantastic example. I only did a few minor tweaks to your CSS:
Code:
h2 { text-align: center; margin-top: 1em; margin-bottom: 1em; margin-left: 0; margin-right: 0; border-top: 3px solid; height: 0.5em; } .text { float: left; width: 25%; margin-top: -.5em; margin-bottom: 0; margin-left: 37.5%; margin-right: 37.5%; background: white !important; } p { text-align: justify; text-indent: 0em; } In ADE: Tested it in Calibre, you get this oddity (border appears at the very top, and not through the middle): JPG?!?!?!?! You disappoint me! Have I taught you nothing about the superiority of PNG for artificial images?!!?!? ![]() Quote:
Definitely much further than where I was previously! ![]() Quote:
I will put this one in my pocket and take a look though. Quote:
I always use the uncondensed version anyway, seems much easier to understand/read (especially if others open the book and want to quickly tweak something). Last edited by Tex2002ans; 02-12-2014 at 12:57 AM. |
|||
![]() |
![]() |
![]() |
#8 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,213
Karma: 34984682
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
|
@Tex -- hey, I think the Calibre "oddity" is not bad. The user would likely think it is a deliberate design choice.
|
![]() |
![]() |
![]() |
#9 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,711
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Well, it seems that if we set the line color to some kind of grey, all is solved. See this picture: I reached that solution by using: Code:
h2 {
text-align: center;
margin: 1em 0 1em 0;
font-size: 1.4em;
border-top: 3px solid #999;
height: 0.5em;
}
Regards Rubén EDIT: "border-top: 3px solid;" -as Tex used- works even better -in night mode- than "border-top: 3px solid #999;" Last edited by RbnJrg; 02-12-2014 at 09:39 AM. |
|
![]() |
![]() |
![]() |
#10 | |||||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,711
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
![]() Quote:
Quote:
![]() ![]() Quote:
![]() Regards Rubén |
|||||
![]() |
![]() |
![]() |
#11 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,711
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#12 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
http://needsmorejpeg.com/ ![]() (You should upgrade to PNG in your posts as well, that last one had such bad haloing artifacts.) Hmmm.. now am I just going crazy? My Kindle Previewer shows the line up top and not centered as it does in yours: Last edited by Tex2002ans; 02-12-2014 at 07:32 AM. |
|
![]() |
![]() |
![]() |
#13 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,711
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
![]() ![]() Quote:
Code:
border-top: 3px solid; Last edited by RbnJrg; 02-12-2014 at 09:40 AM. |
||
![]() |
![]() |
![]() |
#14 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,711
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
I think I found the final solution with the following css code:
Code:
h2 { height: 2em; border-bottom: 3px solid; margin-top: -1em; margin-bottom: 1em; font-size: 1.4em; text-align: center; } .text { float: left; width: 20%; line-height: 2.8em; font-size: 1.4em; margin-left: 40%; margin-right: 40%; background: white !important; } p { text-align: justify; text-indent: 0em; } And this is the look in Kindle Previewer (Kindle Fire - Night Mode): Below I attach the respective epub. Regards Rubén |
![]() |
![]() |
![]() |
#15 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,546
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Not very nice in my browser, if you ask me.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Question marks in the middle of words? | rockster | Calibre | 3 | 02-02-2013 03:58 PM |
PRS-505 In middle of screen is a triangle with ! in middle | toad1960 | Sony Reader | 0 | 12-30-2011 01:30 PM |
Two columns of text, line down middle? | chingu | ePub | 2 | 09-04-2011 06:12 PM |
yet another heading question | jhempel24 | Sigil | 3 | 11-25-2010 07:58 AM |