Thread: CSS Question
View Single Post
Old 11-09-2020, 12:35 PM   #4
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,929
Karma: 169810634
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by thiago.eec View Post
I was sure using !important would do the trick, but it doesn't.
So, here is another way:

Code:
p {
  text-indent: 2em;
}
.noindent p {
  text-indent: 0em;
}
One problem with using that solution is that it does not seem to allow using <p class="noindent"> to not indent a single paragraph. I've attached a sample image from calibre's ebook-viewer where the last two paragraphs should not have an indent.

Spoiler:
Code:
<body>
  <p>The dwarf ignored them. <i>She’ll keep trying to crack me if I say my hounds</i> <i>told me.</i> “So, what? Another twenty blocks to go?”</p>

  <p>“Something like that. Do you think you can keep your knife on your belt for that long?”</p>

  <div class="noindent">
    <p>He scowled “We’ll see what happens.”</p>

    <p>They made it twelve blocks before Rex and Luther both barked sharply.</p>

    <p>“Hey, you smell that?”</p>

    <p>“Yeah. Same smell in the deli. On that dented square on the floor.”</p>

    <p>Johnny stopped on the dark street corner. “Hold on.”</p>

    <p>Lisa had almost stepped onto the crosswalk in the street before she realized he wasn’t beside her anymore. “What?”</p>
  </div>

  <p class="noindent">“Somethin’s off.”</p>

  <p class="noindent">She fixed him with an irritated look. “Johnny, you gotta give me more than that.”</p>
</body>
Attached Thumbnails
Click image for larger version

Name:	test_page_ebookviewer.png
Views:	195
Size:	47.2 KB
ID:	183304  
DNSB is offline   Reply With Quote