View Single Post
Old 09-26-2015, 07:18 PM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,144
Karma: 60406498
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by ignaz wrangel View Post
Hi everybody I'm a css and epub beginner.

My source consists of many continuous blocks of text whose paragraphs are marked by an indent. I wanted the first paragraph each block to be un-indented so I added some css
Code:
p {
  margin: 0; }
p + p {
  text-indent: 1em; }
But the source also includes paragraphs separated by line breaks, and this is where I had trouble. Flightdeck says that <br /> is not allowed in epubs, and sigil wanted to clean up the html by wrapping each one in <p> tags. Of course this meant that every first paragraph in a block was now preceeded by a <p> and got indented.

I found a solution already which is to wrap all the break tags in div tags, but my question is: is this a reasonable solution? What is the normal approach?

Should all of these blocks be contained by tags?

Should I add a class to every first paragraph of every block that follows another?

Thanks for any tips
Flightcrew is simply reminding you No Nekid Br allowed

You could include it inside the last </p
put it in a <div pair to prevent tripping your p+p, that might be unnecessary as the div needs to just contain a nbsp for a 1 liner break
or turtle91 style it with its own class which also allows for full
CSS control . < I like this one. I am not trying to save a few dozen bytes
theducks is online now   Reply With Quote