04-03-2013, 01:51 AM | #1 |
Junior Member
Posts: 8
Karma: 10
Join Date: Apr 2013
Device: Kindle Touch
|
Creating Indents on <br class="calibre1" />
I'm having trouble editing an epub in Sigil that has breaks after each paragraph as
<br class="calibre1" /> I'm trying to get all the new paragraphs to be indented. It looks like this <p class="calibre2">Text goes here and its a paragraph and reading this is boring blah blah blah.<br class="calibre1" /> This is the new line, this is where I cannot seem to get an indent for the new line, causing all the text to be broken into different paragraphs correctly, but not indent these lines<br class="calibre1" /> This line would also not be indented as I would like... I'm able to edit the sytlesheet to have the calibre2 be indented. But I cannot get the calibre1 to be indented and I need to maintain the <br ... /> structure in the document because to do otherwise is immensely painful. I've tried adding this to the style sheet .calibre1 { text-indent: 1.5em; } br.calibre1 { text-indent: 1.5em; } br { text-indent: 1.5em; } I've even tried changing it from <br.../>/ to <p.../> and adding the proper entries in the style sheet. But i still cant seem to touch it because of the <.../> formatting. Am I missing something? |
04-03-2013, 02:38 AM | #2 |
Well trained by Cats
Posts: 29,802
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
You have 1 big paragraph with forced line breaks
IMHO that is a horrible way to do things (in most cases) I suggest converting those <BR /> into </p> <p class="calibre1"> |
Advert | |
|
04-03-2013, 03:00 AM | #3 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Simply put: the input document is wrong, that's one of the reasons one should not use <br/> for paragraph breaks, you cannot get indents. Do as theducks says and add proper paragraph breaks.
|
04-03-2013, 08:29 PM | #4 |
Autism Spectrum Disorder
Posts: 1,212
Karma: 6244877
Join Date: Sep 2011
Location: Coastal Texas
Device: Android Phone
|
I'd suggest the Smashwords Nuke: copy everything into notepad, reimport the resulting .txt, and craft your own style sheet.
|
04-03-2013, 09:57 PM | #5 |
Junior Member
Posts: 8
Karma: 10
Join Date: Apr 2013
Device: Kindle Touch
|
What need to happen and how I fixed it:
I just did a search for all <br class="calibre1" /> and replaced with <p class="calibre1" /> Then I `Saved` and re-opened, this causes Sigil to add <p>the text</p> wherever those things are located (or something, I might be wrong, but it changes it). Then the stylesheet worked. |
Advert | |
|
04-04-2013, 02:28 AM | #6 | |
Zealot
Posts: 114
Karma: 5246
Join Date: Jul 2010
Device: none
|
Quote:
</p> <p class="calibre1"> so that you end the first paragraph (with </p>) and then start a new one (with <p class="calibre1">). Whatever you used worked because Sigil uses Tidy, which "corrected" all the syntax for you, but I'd be careful in the future as Tidy sometimes goes into crazy-overzealous-correcting mode if the code is too badly messed up. Note that there's no <p /> tag, the end paragraph tag is </p>, which comes after <p>. <br> is a special case, it only has a start tag and no end tag; so use <br> in html and <br /> in xhtml, c.f. https://developer.mozilla.org/en-US/...TML/Element/br |
|
04-04-2013, 08:14 AM | #7 |
A Hairy Wizard
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Just my .02¢...
I would replace <br class="calibre1" /> with </p><p> (no class). I find it unnecessary to define a class for a normal paragraph. Simply style the normal paragraph in your CSS with p {text-indent: 1.5em} Then you only need to add classes to paragraphs that are different. This ends up being much cleaner and saves a bunch of bloat (smaller file size). Cheers! Last edited by Turtle91; 04-04-2013 at 08:19 AM. |
04-04-2013, 08:16 AM | #8 |
A Hairy Wizard
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Duplicate post
Last edited by Turtle91; 04-04-2013 at 08:17 AM. Reason: Duplicate post |
04-04-2013, 09:17 AM | #9 | |
Well trained by Cats
Posts: 29,802
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:
I am stressing 2 Points: 1) Don't rely on Tidy to make YOUR code clean. 2) Always write/use the cleanest (replacement) solution, don't rely on Tidy. |
|
04-04-2013, 11:32 AM | #10 | |
A Hairy Wizard
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
I was simply commenting that having a class on every normal paragraph is not necessary and leads to bloat. The only purpose to the OP's Calibre1 class was to indent the line...not something that would change the look if it was included as part of the p {} style. |
|
04-04-2013, 04:39 PM | #11 |
Autism Spectrum Disorder
Posts: 1,212
Karma: 6244877
Join Date: Sep 2011
Location: Coastal Texas
Device: Android Phone
|
Or he could create a .indent class and handle it that way?
|
04-04-2013, 04:58 PM | #12 |
Well trained by Cats
Posts: 29,802
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
04-04-2013, 07:58 PM | #13 |
A Hairy Wizard
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
No...the whole point is that you DON'T need a specific class for all your "normal" paragraphs at all. 4000 paragraphs x <p class="indent"> = a lot more space/bloat/file size than just <p> with one style in the css p {text-indent:1.2em}
|
04-04-2013, 09:42 PM | #14 |
Autism Spectrum Disorder
Posts: 1,212
Karma: 6244877
Join Date: Sep 2011
Location: Coastal Texas
Device: Android Phone
|
I got the feeling that he wanted some paragraphs indented, and some not.
|
04-04-2013, 10:11 PM | #15 |
Resident Curmudgeon
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
<p>
<p class="noindent"> <p class="spacebreak"> p { margin-top: 0; margin-bottom: 0; text-indent: 1.2em } .noindent { text-indent: 0 } .spacebreak { margin-top: 2em; text-indent: 0 } There you go; indented, not indented and even a section break. Last edited by JSWolf; 04-05-2013 at 12:10 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
class="none" vs class="none1" | hymie | Conversion | 2 | 10-27-2011 06:45 AM |
Value of Attribute "Class" is Invalid Error | TFaire | ePub | 2 | 09-23-2011 11:25 AM |
Changing or removing <div class="calibrenavbar"> | ptsefton | Recipes | 3 | 05-28-2011 08:30 AM |
How to reduce indents without "removing space between paragraphs" | Skydog | Calibre | 5 | 06-05-2010 12:58 AM |
Line indents using "<div>" tags | HarryT | Kindle Formats | 11 | 04-29-2009 10:18 PM |