View Single Post
Old 04-05-2022, 03:55 PM   #6
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,591
Karma: 14328510
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by AlanHK View Post
I've see a few books using this CSS:

p{margin:0;text-align:justify;}
p+p{text-indent:1.4em;}
I was using that but it's too big of a hammer, even for me. There are times when I want an indent but the previous thing isn't a p, for example, a figure, or a div around whatever, or a blockquote. So now I use
Code:
dl + p,
hr + p,
header + p,
p:first-child {
    margin-top: 1.0em;
    text-indent: 0em;
 }

body p {
    margin: 0;
    padding: 0;
    text-indent: 2em;
}
(I like big fat indents.)

In other words, only specify where you don't want an indent. Also, the logic this way is clearer; saying "no indent for p, but then indent a p when it's after a p" can be confusing for someone looking at your css. With coding/programming it's usually better to make things clear and avoid clever tricks that could be misunderstood or hard to understand.

Last edited by hobnail; 04-05-2022 at 04:01 PM.
hobnail is offline   Reply With Quote