01-21-2023, 08:58 AM | #1 |
Evangelist
Posts: 482
Karma: 32554
Join Date: May 2014
Location: Canada
Device: Kobo Sage
|
Supported HTML/CSS for text breaks?
If this does not belong here, my apologies.
I have been trying to get the coding right for fixing up the text breaks in my personal reads, but they don't show up in my Kobo (Sage) and I wonder if I'm making a mistake (shows up in the browser when I test, but still) or if it just isn't supported in Kobo Ereaders. I should specify that the text appears, but the content from the '::before' and '::after' pseudo elements does not My CSS: Spoiler:
Don't think it's needed, but my HTML: Spoiler:
If there is a different way to do this that will show in Kobo Ereaders (other than inserting the 'content' in the text each time), I would love to hear it. |
01-21-2023, 10:24 AM | #2 |
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
The best spot for that post would be the epub forum:
https://www.mobileread.com/forums/fo...play.php?f=179 But, I just tried your CSS and it works fine in Calibre's editor and viewer. I haven't put it on my Kobo to check it there, though. EDIT: I added it (as a kepub) to my Kobo Forma and it works there in the default reader. Last edited by enuddleyarbl; 01-21-2023 at 10:29 AM. |
Advert | |
|
01-21-2023, 10:33 AM | #3 | |
Evangelist
Posts: 482
Karma: 32554
Join Date: May 2014
Location: Canada
Device: Kobo Sage
|
Quote:
|
|
01-21-2023, 10:41 AM | #4 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
As far as I know the Adobe reading app used for standard epubs on a Kobo does not support any pseudo elements. So you would need to send all your books as kepub to have any chance of it working.
I haven't tested it in kepub myself but it looks like @enuddleyarbl has. I do know from first-hand experience that kepubs support pseudo elements ::first-letter and ::first-line but they are the only ones I've ever tried. |
01-21-2023, 10:49 AM | #5 | |
Evangelist
Posts: 482
Karma: 32554
Join Date: May 2014
Location: Canada
Device: Kobo Sage
|
Quote:
|
|
Advert | |
|
01-21-2023, 01:00 PM | #6 | |
the rook, bossing Never.
Posts: 11,156
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
Quote:
<p class="a-break">- o -</p> (or * * * which is common) The -o- can be an image (fleuron) with tag and class in CSS .a-break { margin-top: <desired space>; margin-bottom: <desired space>; margin-left: 0; margin-right 0; text-align: center; } Any enclosed image or hr will be centred. for the <img or <hr put class="img-break" and then .img-break { height: auto; width: <desired size>% } You can include a padding-top: if you want a top of new page margin. This will work for epub and epub2 converted by Calibre to old mobi, dual mobi, azw3, kfx, epub3 and kepub. |
|
01-21-2023, 01:09 PM | #7 | |
Evangelist
Posts: 482
Karma: 32554
Join Date: May 2014
Location: Canada
Device: Kobo Sage
|
Quote:
Spoiler:
Not the most elegant, but it works, and I'm still learning. |
|
01-21-2023, 02:47 PM | #8 |
Wizard
Posts: 1,094
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
FWIW, this is what I use.
I prefer a cleaner look without fleurons and other break type images. I know some users don't like this because "it does not convert well to text files"... but to that I say... why would I ever want to convert to text or other file types Spoiler:
In the body it looks like this... Spoiler:
|
01-21-2023, 02:59 PM | #9 |
Bibliophagist
Posts: 35,393
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Personally, I use something very similar to what Quoth posted. It works on pretty much every renderer which the majority of the people I've formatted ebooks for prefer. All too often, simple is better than better.
“Simplicity is the ultimate sophistication.” — Leonardo da Vinci |
01-22-2023, 01:38 PM | #10 |
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
One other thing about your OP:
Code:
<p class="pgb">London, England<br> June 1873</p> Sorry I didn't notice it earlier. I was playing with the same document and ran across it when I did a Check Book. |
01-22-2023, 01:54 PM | #11 |
the rook, bossing Never.
Posts: 11,156
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
I'd only use a <br /> in multiline headings, like chapters, that otherwise would wrap badly. Then the multiple lines are one line/entry in any system TOC building.
You might be tempted to use <br/> between lines in a verse of a poem etc, but a "poem first line of verse", "poem body line" and optionally a "poem end of verse" set of styles is better idea. |
01-25-2023, 11:28 AM | #12 | |
Resident Curmudgeon
Posts: 73,970
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
01-25-2023, 11:33 AM | #13 |
Resident Curmudgeon
Posts: 73,970
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
The topic is incorrect. This is not a text break or a page break. This is a marker for a section break.
This is what I use to denote a section break. It works in ePub and KePub. CSS Code:
hr { margin-top: 1em; margin-right: 40%; margin-bottom: 0.9em; margin-left: 40%; border-top: 2px solid; } .noindent { text-indent: 0; } Code:
<p>Last paragraph of this section.</p> <hr/> <p class="noindent">This is the first paragraph of the this section.</p> |
01-25-2023, 12:49 PM | #14 |
the rook, bossing Never.
Posts: 11,156
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
Yes, it's a section break or scene break and need not have text or image. The CSS for a first paragraph at a scene/section break can have no indent and a top margin and top padding instead of explicit text or image to show a break.
|
01-26-2023, 06:07 PM | #15 |
Resident Curmudgeon
Posts: 73,970
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Before I switched how I did section breaks, I used a padding-top: 2em; That worked very well. It even carried over to the next page. Then the next paragraph had no indent.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Convert text formating from CSS to HTML | abraum | Sigil | 6 | 01-14-2022 08:51 AM |
Comparison of supported html and css tags in various ebook formats | GrannyGrump | Workshop | 2 | 07-11-2016 09:33 PM |
List of all (currently) supported CSS properties | ribik | Library Management | 5 | 08-26-2014 07:34 AM |
Bug converting html css text-indent and left-margin | bhoyt | Conversion | 15 | 01-24-2014 07:28 PM |
Supported HTML/CSS tags and properties | Jellby | Bookeen | 9 | 05-04-2008 04:55 PM |