View Single Post
Old 03-21-2019, 02:47 AM   #32
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 681
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by brent63 View Post
The problem is I'm also using using first line indent.
So even the first line of the Dropcap is indented, not a very good look. (see attachment)

How can I remove it from the the first line only.
This is a useful trick:

Code:
p	{
	margin:1em 0 0 0;
        text-align:justify;
	text-indent:0;
}
p+p	{
	text-indent:1.4em;
        margin:0;
}
The first block defines the first p para in a section (e.g. after a heading tag.)
The p+p defines any subsequent p paragraphs -- how they differ from the first.

Here, the first para in a section has a top margin and is flush left, then following no margins with indent.


You'd use it like

Code:
<p><span="Drop">T</span>his is the first para.</p>
<p>And this is the second</p>
Otherwise, you define a new style for the first para:

Code:
p	{text-align:justify;
	text-indent:1.4em;
        margin:0;
}
p.first	{
	margin:1em 0 0 0;
        text-indent:0;
}
Code:
<p class="first"><span="Drop">T</span>his is the first para.</p>
<p>And this is the second</p>

This is how I usually do it, since my books start as conversions from a DTP file and in that the styles do not cascade, each is defined individually, so I map a DTP style to a HTML style.

I prefer to make the plain p style indented, as that's what 99% of most books is, using styles for the special cases.

Last edited by AlanHK; 03-21-2019 at 03:18 AM.
AlanHK is offline   Reply With Quote