View Single Post
Old 07-27-2022, 03:31 AM   #19
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,856
Karma: 146918083
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 Turtle91 View Post
An alternate, and IMHO cleaner, way to do this is by using a <div>:

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}
That keeps the html nice and compact and you know exactly what’s going on in the <div> without the repetitive code bloat. Multiple <div> classes in your css handle the styling in an organized manner.
I don't do things like div.copy. That copy class is also used with <p>. I don't like limiting a class like that.

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.
JSWolf is offline   Reply With Quote