![]() |
#16 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 769
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
Yep. It's not anything esoteric. It's just a lot of what I consider to be extraneous classes.
BTW: Those classes were all being used. Calibre was only able to merge three of the classes at the start (and I believe those were Calibre classes). None were deleted as unused. |
![]() |
![]() |
![]() |
#17 | |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,291
Karma: 20171067
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
Code:
<div class="copy"> <p>Introduction copyright © 1989 Hui Corporation</p> <p>Text copyright ©1956 Hui Corporation</p> <p>Republished in 2012</p> <p>All rights reserved.</p> </div> CSS: div.copy {yadda yadda} div.copy p {yadda yadda} |
|
![]() |
![]() |
![]() |
#18 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,592
Karma: 9499994
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
|
![]() |
![]() |
![]() |
#19 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,914
Karma: 143095300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Code:
<div class="copy"> <p class="noindent">Introduction copyright © 1989 Hui Corporation</p> <p class="noindent">Text copyright ©1956 Hui Corporation</p> <p class="noindent">Republished in 2012</p> <p class="noindent">All rights reserved.</p> </div> Code:
p { margin-top: 0; margin-bottom: 0; text-indent: 1.2em; } .copy { font-size: small; text-indent: 0; margin-top: 0.8em; } .noindent { text-indent: 0; } Last edited by JSWolf; 07-27-2022 at 03:34 AM. |
|
![]() |
![]() |
![]() |
#20 | |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,291
Karma: 20171067
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
How many other places are you going to use the .copy class in your ePub? Last edited by Turtle91; 07-27-2022 at 07:39 AM. |
|
![]() |
![]() |
![]() |
#21 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,542
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
I think he means that even if you only use the "copy" class in a single <div>, you could specify the CSS simply as ".copy" instead of "div.copy", so you don't restrict it only to divs.
Personally, I prefer to be more specific in my CSS, so I know what each class is intended for, and if I later use <p class="copy"> or <em class="copy"> for something different, the generic ".copy" selector won't bite me in back. |
![]() |
![]() |
![]() |
#22 | |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
MOBI, back then (KF7, by and large) didn't even have more than 2 left-margin indents--to get more, you nested blockquotes, lol. And yes, this is an ePUB discussion, but like most, we tried to have double-duty from our files. So...while I may not like finding stuff like that, I try to forbear. After all, only the Gods know what people see when they see OUR stuff, now, 10-12 years later! (I just suffered through a Berkeley, published less than 5 years ago, in a series of 13 or so books, that was forcibly left-justified/ragged-right. Couldn't override it. Suffice to say, I was NOT a happy camper. I know that you guys go in and clean yours, but I just don't have the calletas. We do this commercially. I have ZERO interest in then cleaning up something that I've bought to escape with, if you see what I mean....) Hitch |
|
![]() |
![]() |
![]() |
#23 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,914
Karma: 143095300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#24 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,542
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
In that case, I'd change my selector to "div.copy, p.copy", to make it clear that it's a class intended for divs and ps. But hey, this is mostly a matter of taste and workflow.
|
![]() |
![]() |
![]() |
#25 | |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,291
Karma: 20171067
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Warning - channeling my inner Tex here
![]() Quote:
for example: Code:
p {margin:0; text-indent:1.2em; text-align:left} /* applies to ALL paragraphs */ div.copy {margin:2em 0 2em 1em} /* applies to the div container */ div.copy p {text-indent:0 ; margin-top:.5em; font-family:Borkish} /* applies to all the paragraphs within the div.copy container and has higher priority than any conflicting elements of the basic p tag */ div.copy p.signature {text-align:right} /* applies to only the paragraphs within the div.copy container with a class="signature" and has higher priority than any conflicting elements of the basic p tag or p tags within the div.copy*/ ***** Code:
<div class="copy"> <p>....</p> <p>....</p> <p>....</p> </div> Code:
<div class="copy"> <p class="copy">....</p> <p class="copy">....</p> <p class="copy">....</p> </div> ***** I only need to have a class name for specific paragraphs that are different from the standard child paragraph style. My example ends up with much cleaner html and more logical/readable css. I minimize using unspecific classes because there is a possibility of confusion when I'm looking at the html... What styling should be applied with the following??: Code:
.copy {yadda yadda} <blockquote class="copy"> <div class="copy"> <p class="copy"> <table class="copy"> <ul class="copy"> <ol class="copy"> <sup class="copy"> <span class="copy"> HTML: Code:
<div class="letter"> <p>....</p> <p>....</p> <p class="signature">....</p> </div> <div class="email"> <p>....</p> <p>....</p> <p class="signature">....</p> </div> <div class="journal"> <p>....</p> <p>....</p> <p class="signature">....</p> </div> <div class="verse"> <p>....</p> <p>....</p> <p class="signature">....</p> </div> Code:
div.letter {yadda yadda} div.letter p {yadda yadda} div.letter p.signature {yadda yadda} div.email {yadda yadda} div.email p {yadda yadda} div.email p.signature {yadda yadda} div.journal {yadda yadda} div.journal p {yadda yadda} div.journal p.signature {yadda yadda} div.verse {yadda yadda} div.verse p {yadda yadda} div.verse p.signature {yadda yadda} This Code:
<div class="copy"> <p>....</p> <p>....</p> <p>....</p> <p>....</p> <p>....</p> <p>....</p> </div> Code:
<p class="copy">....</p> <p class="copy">....</p> <p class="copy">....</p> <p class="copy">....</p> <p class="copy">....</p> <p class="copy">....</p> Code:
<div class="copy"> <p class="copy">....</p> <p class="copy">....</p> <p class="copy">....</p> <p class="copy">....</p> <p class="copy">....</p> <p class="copy">....</p> </div> Last edited by Turtle91; 07-27-2022 at 01:47 PM. |
|
![]() |
![]() |
![]() |
#26 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,914
Karma: 143095300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Here is the code that works the best.
Code:
<div class="copy"> <p>Introduction copyright © 1989 Hui Corporation</p> <p>Text copyright ©1956 Hui Corporation</p> <p>Republished in 2012</p> <p>All rights reserved.</p> </div> Code:
p { margin-top: 0; margin-bottom: 0; text-indent: 1.2em; } .copy { font-size: small; text-indent: 0; margin-top: 0.8em; } div.copy p { text-indent: 0; } |
![]() |
![]() |
![]() |
#27 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 769
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
Just when I think I'm starting to get comfortable with this stuff.... I'm going to have to rethink what I'm doing with CSS in light of the above.
|
![]() |
![]() |
![]() |
#28 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,291
Karma: 20171067
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
yup...what I said...lol
I still have the question: 'Where are you going to use class="copy" anywhere else in your epub other than in your <div class="copy">???' You could certainly use the name somewhere else, but then the class name wouldn't make sense. So you could reduce your css a bit into: Code:
p { margin-top: 0; margin-bottom: 0; text-indent: 1.2em; } div.copy p { text-indent: 0; font-size: small; margin-top: 0.8em; } |
![]() |
![]() |
![]() |
#29 | |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,291
Karma: 20171067
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#30 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 769
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
You method is more than just a difference in technique. As you said a couple of posts up, with what you're doing, you get more semantically defined CSS. The HTML of the book is staying pretty generic, but the semantic aspect of the CSS lets the HTML behave differently based on what it is.
What I've been doing has been using a simple set of CSS that I change in the HTML depending on what I want the page to look like. Many of the published books I've been reformatting have HTML/CSS that looks like it was pushed out by and for a program simply because it's in their system and no human will ever see the underlying code. With the above, it looks like the HTML and CSS stays readable and understandable, but can be adapted to behave differently without too much trouble. I'll have to play with this. |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |