View Single Post
Old 07-16-2009, 04:10 AM   #9
rogue_ronin
Banned
rogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-books
 
Posts: 475
Karma: 796
Join Date: Sep 2008
Location: Honolulu
Device: Nokia 770 (fbreader)
Quote:
Originally Posted by pdurrant View Post
Yes - seems a bit of an oversight to me. So adding in a first-word span seems the best solution.
Done, it's in my tools as <span class="FirstWord">

Quote:
No and yes. There isn't a first paragraph pseudo-class, but if you enclosed the sections that should have a special first paragraph with a div of class parablock, you could use

Code:
div.parablock > p:first-child { text-indent: 0; margin: 0 }
rather than assuming that the first para always follows an h4.
In my case, where I'm auto-generating the book sections, and I already have a consistent use of divs to break up sections of the book, I'm a bit averse to adding another set of divs for this simple purpose. (I understand that you are simply giving an example, not suggesting a solution.)

Also, there will almost always be a header of some sort preceding a first paragraph in most books, right? So you'd have to add the div after the more logical place to divide the text.

I think it's simpler to add a p class: <p class="FirstParagraph">, so that's what I think I'll do. It's more explicit, as your div.parablock example offers, but I think it's closer to the bone.

I could probably code something like:

Code:
h2,h3+p { text-indent: 0; margin: 0 }
since my books should always have the content immediately after one of those two headers. But there may be exceptions, and why rewrite the CSS if I don't have to?

(Or should that be:

Code:
h2+p,h3+p { text-indent: 0; margin: 0 }
??)

m a r
rogue_ronin is offline   Reply With Quote