![]() |
#1 |
Read, don't parrot.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 224
Karma: 110242
Join Date: Apr 2011
Device: Kindle Fire, Kobo Touch, Aldiko for Android
|
How can I amend the style definition in HTML to fix Kindle default?
This is not my problem because I convert to mobi before upload to Kindle, but I'm trying to help out those who just want to upload HTML to Kindle for conversion:
Kindle's converter automatically indents the first line of every paragraph. So if you want your paragraphs to flush left, Kindle advises: "The first line of each paragraph indents by default. You can change the indentation of the first line of a paragraph using the width attribute: <p width="N"> (pixels), <p width="N%">,<p width="Nem"> or <p width="Npt">" Now, who wants to do that all through a 300-page book? I would think there might be a way to amend the Normal paragraph style definition instead. For example, in a document with a flushed left paragraph, justified, and with a 12 pt space after it, the definition looks like this: p.MsoNormal, li.MsoNormal, div.MsoNormal {margin-top:0in; margin-right:0in; margin-bottom:12.0pt; margin-left:0in; text-align:justify; font-size:10.0pt; font-family:Georgia;} Does anyone know how or where the above definition might be amended as per Kindle's suggestion? I've tried various ways without success. If not, the code for my paragraphs reads: <p class=MsoNormal>blah blah blah blah.</p> Where would I add the <p width="N"> code (or one of the other variants listed by Kindle). I've tried before and after the <p class=MsoNormal> but with no success either. Thanks. P.S. I am aware of formatting workarounds in Word, but this question is about code. |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,400
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
The "text-indent" CSS attribute is how you control the indentation in the first line of each paragraph. I have absolutely no idea how Kindle's converter will handle that css, though. I've never used it. I assume you're talking about sending HTML files to your Kindle's email address and having them convert the files for you?
To eliminate the indentation and make it flush with the other lines, just add the "text-indent:0;" to your existing css: Code:
p.MsoNormal, li.MsoNormal, div.MsoNormal { margin-top:0in; margin-right:0in; margin-bottom:12.0pt; margin-left:0in; text-align:justify; text-indent: 0; font-size:10.0pt; font-family:Georgia; } |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
eBook Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 85,544
Karma: 93383099
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
Doing the replacement through a whole book involves no more than doing a search and replace of "<p>" with "<p width="1em">" (or whatever your preference is).
|
![]() |
![]() |
![]() |
#4 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,613
Karma: 6718541
Join Date: Dec 2004
Location: Paradise (Key West, FL)
Device: Current:Surface Go & Kindle 3 - Retired: DellV8p, Clie UX50, ...
|
Quote:
In addition, the indent along with top and bottom margins should be specified in em units rather than a fixed size unit so that they remain proportional to the text size when the reader chooses a different base text size. This would be more appropriate: p.MsoNormal, li.MsoNormal, div.MsoNormal {margin-top:0; margin-right:0; margin-bottom:1em; margin-left:0; text-align:justify; text-indent: 0; } |
|
![]() |
![]() |
![]() |
#5 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,259
Karma: 145488788
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Code:
p.MsoNormal, li.MsoNormal, div.MsoNormal { margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; text-align: justify; text-indent: 1.2em } |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Read, don't parrot.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 224
Karma: 110242
Join Date: Apr 2011
Device: Kindle Fire, Kobo Touch, Aldiko for Android
|
Quote:
|
|
![]() |
![]() |
![]() |
#7 |
A Thirsty Mind
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 92
Karma: 2546
Join Date: May 2011
Location: Lubec, Maine
Device: Kindle Fire, iPad, iPhone
|
Well, I agree with all of the above, but I get a bit more explicit about it. I also build a new style for a flush left....NormalFlush...and base it on the regular Normal style and in the style description in html for NormalFlush I make sure this text is there:
margin-top:0in; margin-right:0in; margin-bottom:0in; margin-left:0in; text-indent:0in; font-size: whatever you want to use Probably the "in" part isn't necessary, but I've left it off, and left off the semi-colon or the colon...and it doesn't work...so I use exactly this every time. I don't have a problem with the prc (mobi) ever. Just insert text-indent:0in; in whichever Style that you want to Flush left and you won't have to worry anymore |
![]() |
![]() |
![]() |
Tags |
html, kindle indent, style definitions |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
newbie - keep original html and style | Ray Tayek | Calibre | 7 | 12-01-2010 02:11 PM |
Import of HTML With Embedded <Style> Broken In 0.7.5 | Oboe Joe | Calibre | 2 | 06-27-2010 10:35 AM |
HTML to .MOBI: large l.h. margin; text cuts off on the rt. Ideas how to fix? | thorn | Calibre | 1 | 02-21-2010 01:47 AM |
Changing default text style? | jyavenard | Kindle Developer's Corner | 5 | 09-29-2009 09:38 AM |