![]() |
#1 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 115
Karma: 97138
Join Date: Jul 2010
Device: nook, prs-650, prs-350, galaxy tab 2
|
Css code to indent first paragraph?
With the help of some I figured out my problem with the oversize first letter of each chapter, however when I resize the letter there is no indention for the first paragraph. Can anyone advise me the code to make an indention for that paragraph?
|
![]() |
![]() |
![]() |
#2 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,022
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Normally, the first paragraph of a chapter or first paragraph after a section break isn't indented. if this is what's happening, then just leave it be.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,612
Karma: 29710338
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
But as JSWolf says its traditional to not indent the first paragraph in a chapter or scene - not sure what the rational for that is. I suspect it harks back to the likes of King Ælfred the Great writing illuminated manuscripts on vellum ![]() BR |
|
![]() |
![]() |
![]() |
#4 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,022
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
From what I suspect, it stems from wanting to show that you are at a new chapter or section. To me, it just looks odd with indents where we would normally have no indents.
|
![]() |
![]() |
![]() |
#5 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,891
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Another visual treatment is to use a Larger Left Margin and do a Hanging Indent (text-indent: -2em; ) |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,022
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
![]() |
![]() |
![]() |
#7 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,891
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
![]() |
![]() |
![]() |
#8 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
Quote:
For my personal reading, I use a line before for every paragraph since I find it easier to read that way. Last edited by phossler; 11-15-2015 at 08:30 PM. |
|
![]() |
![]() |
![]() |
#9 | |
Connoisseur
![]() ![]() ![]() Posts: 79
Karma: 228
Join Date: Aug 2014
Device: lambda k21
|
Quote:
|
|
![]() |
![]() |
![]() |
#10 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 115
Karma: 97138
Join Date: Jul 2010
Device: nook, prs-650, prs-350, galaxy tab 2
|
Can anyone post the code to change the size of the first letter that in the dropcaps?
|
![]() |
![]() |
![]() |
#11 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,022
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
The problem with drop caps is it doesn't work well if the font size is changed, the line height is changed, and/or the font is changed. So it's best to not use drop caps. A larger cap is best for the first paragraph of the chapter.
|
![]() |
![]() |
![]() |
#12 |
The Fumbler
![]() Posts: 66
Karma: 10
Join Date: Jun 2015
Device: android 4.2/fbreader
|
The size of the first letter in a paragraph is probably controled by a CSS file. In the CSS file you would find something like:
span.dropcaps { float: left; font-size: 100px; line-height: 100px; padding-top: 1px; margin-top: -.10em; margin-right: .09em; color: #5E5E5E; } Then the first character in each paragraph is coded something like this: <span class="dropcaps">W</span> "Dropcaps" is the class name and it could be something else. Whatever is in the <span> statement is what you are looking for. You can change the size of the first letter by changing the class in the CSS file. For example, to reduce the size from 100 pixels to 50 pixels change the CSS file to look like this: span.dropcaps { float: left; font-size: 50px; line-height: 50px; padding-top: 1px; margin-top: -.10em; margin-right: .09em; color: #5E5E5E; } That will effectively change the size of all letter surrounded by <span class="dropcaps">Whatever</span>. An alternative is to eliminate the "dropcaps" altogether resulting in a font size that is normal for the paragraph. This can be accomplished with a Regex search and replace: Search: <span class="dropcaps">(.*?)</span> Replace: \1 Actually, I would change that search to <span class="dropcaps">(((?!<span).)*?)</span> just in case there exist nested spans in you book. I hope that helps. Merry Christmas ![]() |
![]() |
![]() |
![]() |
#13 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 115
Karma: 97138
Join Date: Jul 2010
Device: nook, prs-650, prs-350, galaxy tab 2
|
Thanks guys. I took the suggestion to eliminate drop caps altogether. That is much better.
|
![]() |
![]() |
![]() |
#14 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,022
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Something like this works well...
Code:
.firstletter { font-size: 2em; line-height: 0 } |
![]() |
![]() |
![]() |
#15 |
mostly an observer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,518
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to block indent a paragraph? Center a seperator? | Tarana | Editor | 10 | 08-23-2015 09:54 AM |
How do I set paragraph indent? | pargoo | Sigil | 17 | 11-09-2013 06:38 PM |
Selective paragraph indent | Leonatus | Writer2ePub | 8 | 10-31-2013 04:22 PM |
HTML- Paragraph indent w/ no spaces? Help please? | Joseph Picard | Workshop | 36 | 07-20-2012 12:35 PM |
Preference: Paragraph indent or a little paragraph spacing? | 1611mac | General Discussions | 48 | 11-11-2011 12:43 AM |