View Single Post
Old 08-22-2023, 01:17 PM   #1803
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: 79,796
Karma: 146391129
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 nabsltd View Post
Early in the days of actual CSS (i.e., not MOBI), the one class applied all the formatting to a element (margins, font, etc.).

Recently, the publishers have finally discovered that the "C" in CSS means "Cascading", and now have gone to the complete opposite, where a class does one thing (like margins), another does the font, and another does the text-align.

And, the last line is likely because they used a p + p selector to create indented paragraphs, but then realized they had to special case after every div, because div + p created too many issues.

The recent one that got me was during the crossover between the early way and the current method (style inline for easier reading):
Code:
<div style="margin: 1em">
  <p style="margin-top: 1em;">Stuff</p>
  <p>More stuff</p>
  <p style="margin-bottom: 1em;">Last of stuff</p>
</div>
The paragraphs use the old "all formatting in one place" version, but the outer div creates the block quote, so there is no need to put margins on the paragraphs themselves.
Code:
<div class="ext_ch">
<div class="decoration-rw10">
<div>
<div class="pc-rw">
<img alt="image" class="orn" src="images/Art_sborn.jpg"/>
</div>
</div>
</div>
</div>
<p class="noindent">
But that code makes no sense at all. 3 divs with classes and one empty div. All of that can be done with one div and one class. It's just crazy how publishers can make code that's not actually readable.

Last edited by JSWolf; 08-22-2023 at 03:36 PM.
JSWolf is offline   Reply With Quote