Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 01-21-2023, 08:58 AM   #1
MerlinMama
Evangelist
MerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beauty
 
MerlinMama's Avatar
 
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:
Code:
.pgb {
	font-family: "Cooper Black", serif;
	font-size: 110%; 
	text-align: center;
}
.pgb::before {
	display: block;
	position: relative;
	content: '*~=^;^=~*';
	font-family: Georgia, serif;
}
.pgb::after {
	display: block;
	position: relative;
	content: '*~=^;^=~*';
	font-family: Georgia, serif;
}


Don't think it's needed, but my HTML:
Spoiler:
Code:
<p class="pgb">London, England<br>
June 1873</p>


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.
MerlinMama is offline   Reply With Quote
Old 01-21-2023, 10:24 AM   #2
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
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.
enuddleyarbl is offline   Reply With Quote
Advert
Old 01-21-2023, 10:33 AM   #3
MerlinMama
Evangelist
MerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beauty
 
MerlinMama's Avatar
 
Posts: 482
Karma: 32554
Join Date: May 2014
Location: Canada
Device: Kobo Sage
Quote:
Originally Posted by enuddleyarbl View Post
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.
Ok thank you. Maybe it doesn't work because I have it as Epub. I'll try that forum.
MerlinMama is offline   Reply With Quote
Old 01-21-2023, 10:41 AM   #4
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
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.
jackie_w is offline   Reply With Quote
Old 01-21-2023, 10:49 AM   #5
MerlinMama
Evangelist
MerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beauty
 
MerlinMama's Avatar
 
Posts: 482
Karma: 32554
Join Date: May 2014
Location: Canada
Device: Kobo Sage
Quote:
Originally Posted by jackie_w View Post
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.
Thank you. I had tried a pseudo element before for something else and it *seemed* to work, I'll have to see for sure now...
MerlinMama is offline   Reply With Quote
Advert
Old 01-21-2023, 01:00 PM   #6
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,156
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Quote:
Originally Posted by MerlinMama View Post

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.
This is too complicated. Just have the break text in html
<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.
Quoth is offline   Reply With Quote
Old 01-21-2023, 01:09 PM   #7
MerlinMama
Evangelist
MerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beauty
 
MerlinMama's Avatar
 
Posts: 482
Karma: 32554
Join Date: May 2014
Location: Canada
Device: Kobo Sage
Quote:
Originally Posted by Quoth View Post
This is too complicated. Just have the break text in html
<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.
Thank you, but not what I'm hoping for. If I can't figure out something similar to what I was trying with the pseudo elements, I'll just keep on with how I'm currently doing it in HTML:

Spoiler:
Code:
<p class="center">*~ =^;^= ~*<br/>
<span class="pgb">London, England<br/>
June 1973</span><br/>
*~ =^;^= ~*</p>


Not the most elegant, but it works, and I'm still learning.
MerlinMama is offline   Reply With Quote
Old 01-21-2023, 02:47 PM   #8
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
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:
PHP Code:
.scene {
  
padding-bottom0.01em;
  
padding-top2em;
  
text-indent0;
}
.
firstletterscene {
  
font-size1.5em;
  
line-height1em;



In the body it looks like this...

Spoiler:
PHP Code:
  <class="scene"><span class="firstletterscene">B</span>obbie sat in the galley
Karellen is offline   Reply With Quote
Old 01-21-2023, 02:59 PM   #9
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
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
DNSB is offline   Reply With Quote
Old 01-22-2023, 01:38 PM   #10
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
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>
You're missing a closing "/" on that <br> (should be <br/>). Again, it all works on all my stuff. But, I'm wondering if that could be giving you issues on the Kobo with an epub. Unless it's just a typo here, you might try fixing that and trying it on the Kobo again.

Sorry I didn't notice it earlier. I was playing with the same document and ran across it when I did a Check Book.
enuddleyarbl is offline   Reply With Quote
Old 01-22-2023, 01:54 PM   #11
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
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.
Quoth is offline   Reply With Quote
Old 01-25-2023, 11:28 AM   #12
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
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:
Originally Posted by enuddleyarbl View Post
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.
There is no default Reader on Kobo. There are two different programs for reading eBooks and neither is the default.
JSWolf is offline   Reply With Quote
Old 01-25-2023, 11:33 AM   #13
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
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;
}
HTML
Code:
<p>Last paragraph of this section.</p>
<hr/>
<p class="noindent">This is the first paragraph of the this section.</p>
JSWolf is offline   Reply With Quote
Old 01-25-2023, 12:49 PM   #14
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
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.
Quoth is offline   Reply With Quote
Old 01-26-2023, 06:07 PM   #15
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
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:
Originally Posted by Quoth View Post
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.
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.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 06:37 PM.


MobileRead.com is a privately owned, operated and funded community.