Quote:
Originally Posted by nabsltd
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.