11-17-2010, 10:11 AM | #1 |
Wizard
Posts: 2,157
Karma: 7068605
Join Date: Dec 2007
Device: Amazon Kindle Paperwhite, B&N Nook Colro
|
First paragraph line indents
I know that I can put something like:
p {text-indent: 15px} or something like that in the CSS file to indent the paragraphs, but for whatever reason on some epubs, it won't do it. I've also noticed that when I select a header it won't add it to the TOC, nor will it even be recognized in HTML view as it having a header selected...anyone else have thoughts/problems with this? |
11-17-2010, 10:30 AM | #2 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Maybe those epubs use <div> instead of <p>, or have some predefined class that overrides your CSS, like <p class="text"> with "p.text { text-indent: 0; }". You'd have to examine the code to see what's happening.
|
Advert | |
|
11-17-2010, 10:31 AM | #3 |
Well trained by Cats
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Something(s) is overriding your (very global ) setting.
p.firstpara {text-indent: 2% } would specify that you only want it applied to paragraphs that have a tag Code:
<p class="firstpara"> |
11-17-2010, 10:50 AM | #4 |
Wizard
Posts: 2,157
Karma: 7068605
Join Date: Dec 2007
Device: Amazon Kindle Paperwhite, B&N Nook Colro
|
That's got to be what it is. Every paragraph has a tag it is a converted prc. And they don't just have the p tag they have the p class tag. Thanks for the help, it's appreciated.
|
11-17-2010, 11:20 AM | #5 | |
Well trained by Cats
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Code:
<p class="original_selector firstpara"> |
|
Advert | |
|
11-18-2010, 01:05 AM | #6 |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Guys: it's easier to set a style for the p tag itself, i.e., p {text-indent:3em;} and nuke all the damned classes except for the exceptions, e.g., scene changes or the first paragraph of a Chapter...use search and replace to change all your <p class="blabeety blabbety"> to <p>. MUCH easier.
HTH, Hitch |
11-18-2010, 01:07 AM | #7 |
Wizard
Posts: 2,157
Karma: 7068605
Join Date: Dec 2007
Device: Amazon Kindle Paperwhite, B&N Nook Colro
|
I understand what you are saying, but the book I'm working with as "class" tags, it really is easier to do with just the <p> tag.
|
11-18-2010, 01:35 AM | #8 |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
jhempel24: it only has class tags because somebody styled them that way. They're not immutable; they're just styling. The class isn't a "tag," per se; it's simply a...shorthand mechanism of using stylesheets. If cleaning the file up isn't your bag, then go edit the stylesheet and fix the definitions for the class tags you think you're stuck with. {shrug}. Best advice I can give you....other than the advice I already gave you. ;-)
HTH Hitch |
11-18-2010, 01:47 AM | #9 |
Wizard
Posts: 2,157
Karma: 7068605
Join Date: Dec 2007
Device: Amazon Kindle Paperwhite, B&N Nook Colro
|
Yeah I know what you mean, but I wasn't going to go through an 800 page book and delete them all, when I just wanted paragraph indentation, in which I found it in the style sheet. I don't know why I didn't think that I couldn't adjust the specific class, I guess I thought it would indent the entire paragraph and not just the first line....this is what I have now for it:
.calibre6 { display: block; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0em; text-align: left; text-indent: 15pt } This is a paragraph from the books: <p class="calibre6">There were no lights on the coast of France; only the wash of the dying moon outlined the rocky shore. They were two hundred yards from land, the fishing boat bobbing gently in the crosscurrents of the inlet. The captain pointed over the side.</p> |
11-18-2010, 04:51 AM | #10 |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
jhempel24: Hope I was helpful. That's a big indent, from my perspective--but now you know you can tweak it, so, play with it until you find a format you like.
P.S. - I wasn't suggesting you go through an 800 page book and delete them all, manually; I was suggesting that you search for <p class="blabbety"> and replace it with <p>. Automagically. ;-) Hitch |
11-23-2010, 07:26 PM | #11 |
Evangelist
Posts: 490
Karma: 1665031
Join Date: Nov 2010
Location: Vancouver Island, Nanaimo
Device: K2 (retired), Kobo Touch (passed to the wife), KGlo, Galaxy TabPro
|
I have simplified mine. Strip all class/div or any other tags you don't want using Find & Replace, applied to the "current file" or "All HTML Files" that you have open.
This is my style sheet for my Kobo ePubs: /* set all page margins: top 15px, left/right/bottom 0px */ @page { margin: 15px 0px 0px 0px; } /* h1 used for book title & author name */ h1 { text-align: center; } /* h2 used for all chapter heading */ h2 { text-align: center; page-break-before: always; padding: 0; margin: 1em; } /* set all paragraphs to justify & leave 8px between paragraphs */ /* this margin separates the paragraphs enough to make reading */ /* but not enough to make it obvious */ p { text-indent: 35px; text-align: justify; padding: 0; margin: 8px; } |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding indents / removing line spacing for news | jubcoo | Calibre | 4 | 10-27-2010 04:39 PM |
Sony PRS-505, text indents, paragraph spacing | pdurrant | Sigil | 7 | 08-03-2009 06:03 AM |
convert to lrf : paragraph indents, line breaks | karo02 | Calibre | 4 | 01-27-2009 09:19 AM |
Paragraph indents from command line | JSWolf | Calibre | 4 | 11-06-2008 08:41 PM |
last line in each paragraph centred | scgf | Calibre | 9 | 09-10-2008 02:23 PM |