View Single Post
Old 04-18-2020, 08:46 PM   #2
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,355
Karma: 20171571
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
They probably had some template somewhere...or that's how they were told to do it... or they had some automated software that did it that way and they didn't know any better. There is no requirement to have them.

It ultimately boils down to technique, but having extra code bloat causes the renderer to have to decode all that extra styling. This slows down the display of your book (much more noticeable on older devices) and could ultimately cause the book to be unreadable.

I always remove those unnecessary classes.

I've seen some ridiculous tags like:
<p class="para">
<i class="italic">
<b class="bold">

For a nice 'clean' code, I define the standard styling, then only add classes to those special situations where they are different than the standard.

eg:
Code:
CSS
p        {margin:0; text-indent:1.2em}
p.banner {margin:2em 0; text-indent:0; text-align:center; font-weight:bold}

HTML
<p>Standard paragraph.</p>
<p>Standard paragraph.</p>
<p>Standard paragraph.</p>
<p>Standard paragraph.</p>
<p class="banner">Paragraph with special formatting.</p>
<p>Standard paragraph.</p>
<p>Standard paragraph.</p>
<p>Standard paragraph.</p>
<p>Standard paragraph.</p>
Turtle91 is offline   Reply With Quote