07-26-2022, 09:42 AM | #1 |
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
Point of "<br class="calibre1"/>"?
In almost every epub that I play with, I see things like:
Code:
<br class="calibre1"/> Code:
.calibre1 { display: block; } Similarly, I wonder about self-closing <a and <p tags with classes inside them that don't actually DO anything but set an id= . What's the point of the formatting classes inside them? |
07-26-2022, 10:22 AM | #2 |
Resident Curmudgeon
Posts: 74,027
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
In your example, there's no point to <br class="calibre1"/>. When I find them, I convert them to <br/>. They do exactly the same thing. Also, if you come upon something like <i class="calibre4">, that can be changed to just <i>.
|
Advert | |
|
07-26-2022, 10:36 AM | #3 |
Evangelist
Posts: 482
Karma: 2267928
Join Date: Nov 2015
Device: none
|
They correspond to special page break elements at the end of every chapter for MOBI (MOBI files are one big stream and need explicit page breaks.)
|
07-26-2022, 10:41 AM | #4 |
A Hairy Wizard
Posts: 3,097
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
I see this quite often too… usually the calibre4 says something silly like “font-style:italics” in which case it is totally reasonable to just use <i> (If it makes you feel good, or are CDO like me you can add i {font-style:italics} to your css sheet)… but make sure it doesn’t have something else as well. Some times you might see something that changes the color, underline, or font type, etc. and you want to make sure you account for that.
Last edited by Turtle91; 07-26-2022 at 10:44 AM. |
07-26-2022, 01:26 PM | #5 |
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
Since I always see a <br class="calibre1"/>, is that construct added by Calibre's conversion process? Perhaps to handle the MOBI case Sarmat89 noted, above?
Of course, I see tons of non-Calibre classes used in the same way (and in things like <i class=...>, <b class=..., <em, strong, sup, sub, etc., etc.). And, as JSWolf suggested, I just convert them back to their base tags. |
Advert | |
|
07-26-2022, 01:38 PM | #6 | |
Bibliophagist
Posts: 35,474
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
One of the many reasons I now use KindleUnpack to convert azw3/KF8 to epub is that the css is not munged in the process. Last edited by DNSB; 07-26-2022 at 01:40 PM. |
|
07-26-2022, 03:31 PM | #7 |
Wizard
Posts: 1,103
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
You don't state where the <br/> is used in the text, but my understanding is that using <br/> as a scene break is a no-no. Is that what you are using it for? It's ok for in-line use.
https://developer.mozilla.org/en-US/...ility_concerns I tend to use <p> </p> |
07-26-2022, 03:43 PM | #8 | |
Resident Curmudgeon
Posts: 74,027
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
<p class="copy">Introduction copyright © 1989 Hui Corporation<br/>Text copyright ©1956 Hui Corporation<br/>Republished in 2012<br/>All rights reserved.</p> |
|
07-26-2022, 03:56 PM | #9 | |
Wizard
Posts: 1,103
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
But I tend to remove that anyway and use... <p class="copy">Introduction copyright © 1989 Hui Corporation</p> <p class="copy">Text copyright ©1956 Hui Corporation</p> <p class="copy">Republished in 2012</p> <p class="copy">All rights reserved.</p> I would love to know if there is any difference between the two methods and if one should be used over the other and why. |
|
07-26-2022, 04:14 PM | #10 | |
Resident Curmudgeon
Posts: 74,027
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
I used to remove the <br/> when it splits lines, but I'm just don't want to do it. I do remove any <br/> that's used a line space. |
|
07-26-2022, 04:22 PM | #11 |
Wizard
Posts: 1,103
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
|
07-26-2022, 06:02 PM | #12 |
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
In general, I don't use <br/> or <p></p> for paragraph spacing. I see a lot of that in the books I'm reformatting and I tend to just remove them. Where I do use <br/> is like JSWolf did, above, in his copyright example.
In fiction epubs, I really haven't really run across a need for particular vertical spacing of paragraphs or other elements. That's why I'm constantly surprised by <br class="... elements for a large number of text sizes. Earlier today, I ran across a book that had about 36 different classes for paragraphs (besides Calibre's automatically produced varieties). They used an awful lot of those classes in <br tags (I guess so the vertical spaces they wanted matched the rest of the paragraph lines). |
07-26-2022, 06:07 PM | #13 | |
Resident Curmudgeon
Posts: 74,027
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
07-26-2022, 07:40 PM | #14 |
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
The book is "Necropolis" by Michael Dempsey. It was published in 2011 by Night Shade Books. The number of paragraph classes seems a tad excessive to me. But what really bothered me was that with their defaults, every character was something like 3/4 of normal size and the character spacing reduced (I think). I've included the main stylesheet if you're interested:
Code:
@namespace h "http://www.w3.org/1999/xhtml"; .Apple-tab-span { white-space: pre-wrap } .big { font-family: Helvetica; font-size: 2em; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; text-align: justify } .calibre { display: block; font-size: 1.29167em; line-height: 1.2; margin-bottom: 0; margin-left: 5pt; margin-right: 5pt; margin-top: 0; padding-left: 0; padding-right: 0 } .calibre1 { display: block } .calibre2 { display: block } .calibre3 { font-style: italic } .calibre4 { display: block } .chapter { display: block; font-family: Helvetica; font-size: 1.54839em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 18px; margin-left: 0; margin-right: 0; margin-top: 0; text-align: center } .p { display: block; font-family: Helvetica; font-size: 1.54839em; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; min-height: 58px; text-align: center } .p1 { display: block; font-family: Helvetica; font-size: 1.54839em; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; text-align: center } .p10 { display: block; font-size: 0.64516em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; min-height: 13px; text-align: center; text-indent: 10.8px } .p11 { display: block; font-size: 0.77419em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 18px; margin-right: 0; margin-top: 0; text-align: center } .p12 { display: block; font-size: 0.77419em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 18px; margin-right: 0; margin-top: 0; min-height: 14px; text-align: center } .p13 { display: block; font-size: 0.77419em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0 } .p14 { display: block; font-size: 1.54839em; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; min-height: 43px; text-align: justify; text-indent: 13.5px } .p15 { display: block; font-size: 0.77419em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; min-height: 14px; text-align: justify; text-indent: 13.5px } .p16 { display: block; font-family: Helvetica; font-size: 1.29032em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 36px; margin-left: 0; margin-right: 0; margin-top: 0; text-align: center } .p17 { display: block; font-size: 0.77419em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; text-align: justify; text-indent: 0 } .p18 { display: block; font-size: 0.77419em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; text-align: justify; text-indent: 13.5px } .p19 { display: block; font-size: 0.77419em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; text-align: center; text-indent: 13.5px } .p2 { display: block; font-family: Helvetica; font-size: 1.54839em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; text-align: center } .p20 { display: block; font-size: 0.77419em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; min-height: 14px; text-align: center; text-indent: 13.5px } .p21 { display: block; font-size: 0.64516em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; text-align: center; text-indent: 13.5px } .p22 { display: block; font-size: 0.77419em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; text-align: justify } .p23 { display: block; font-size: 0.77419em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; min-height: 14px; text-align: justify } .p24 { display: block; font-size: 0.77419em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; min-height: 14px; text-align: center } .p25 { display: block; font-size: 0.77419em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; text-align: center } .p26 { display: block; font-family: Helvetica; font-size: 0.64516em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; text-align: center } .p27 { display: block; font-family: Helvetica; font-size: 0.77419em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; text-align: justify } .p28 { display: block; font-family: Helvetica; font-size: 0.77419em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 29px; margin-right: 0; margin-top: 0; text-align: justify; text-indent: -9px } .p29 { display: block; font-size: 0.77419em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 27px; margin-right: 0; margin-top: 0; text-align: center } .p3 { display: block; font-family: Helvetica; font-size: 1.54839em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; min-height: 36px; text-align: center } .p30 { display: block; font-size: 0.77419em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 27px; margin-right: 0; margin-top: 0; text-align: justify } .p31 { display: block; font-size: 0.77419em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 27px; margin-right: 0; margin-top: 0; text-align: justify; text-indent: 13.5px } .p32 { display: block; font-size: 0.77419em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 18px; margin-right: 0; margin-top: 0; text-align: justify; text-indent: 13.5px } .p33 { display: block; font-family: Helvetica; font-size: 1.29032em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 18px; margin-left: 0; margin-right: 0; margin-top: 0; text-align: center } .p34 { display: block; font-size: 0.77419em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; min-height: 15px } .p4 { display: block; font-family: Helvetica; font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; min-height: 22px; text-align: center } .p5 { display: block; font-family: Helvetica; font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; min-height: 17px; text-align: center } .p6 { display: block; font-family: Helvetica; font-size: 0.77419em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; text-align: center } .p7 { display: block; font-size: 0.64516em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; text-align: center; text-indent: 10.8px } .p8 { display: block; font-size: 0.64516em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; min-height: 13px; text-align: center } .p9 { display: block; font-size: 0.64516em; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; text-align: center } .s { font-family: Helvetica; font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: 0.2px; line-height: 1.2 } .s1 { letter-spacing: 0.2px } .s10 { font-family: Helvetica; font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: 0.1px; line-height: 1.2 } .s11 { font-size: 0.5em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: 0.1px; line-height: 1.2 } .s2 { letter-spacing: 0.1px } .s3 { font-size: 0.83333em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: 0.2px; line-height: 1.2 } .s4 { font-size: 1.29167em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: 0.1px; line-height: 1.2 } .s5 { letter-spacing: 0.3px } .s6 { font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: 0.1px; line-height: 1.2 } .s7 { letter-spacing: -0.1px } .s8 { letter-spacing: 0.5px } .s9 { letter-spacing: 0.1px; text-decoration: underline } |
07-26-2022, 07:44 PM | #15 | |
Resident Curmudgeon
Posts: 74,027
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"class="calibre"" in the <html header line? | retiredbiker | Conversion | 11 | 06-21-2023 01:25 PM |
Pressing "Restore Defaults" under "Book Details" wipes all "Look & Feel" settings. | MarjaE | Library Management | 1 | 03-30-2021 11:46 AM |
Class action: "sale" royalties on "licensed" ebooks | drjenkins | News | 2 | 06-02-2016 08:44 AM |
Creating Indents on <br class="calibre1" /> | CyanBC | Sigil | 20 | 04-05-2013 11:59 PM |