Forum How do I...?

Indenting paragraphs with text-indent in columns

John
Hello,

I'm using the text-indent attribute to indent the first paragraph in a series of paragraphs following up. Like this:

div.content p + p {
text-indent: 2mm;
}

This works as expected, but when there are page breaks, or in multi-column layout column breaks, in between the series of paragraphs. I'm running into problems. Because after a column- or page-break the first paragraph (which is not the first in the series, but the first on the new column or page) on the new page or column is indented as well. I need to avoid that, as this is how it is usually handled for print media.

Is there a way to "collapse"/overwrite text-indent for an element if it appears as the first on a new page or column?

Greetings,
John

Edited by John

mikeday
No, I don't think so.
John
Hello Mike,

I thought so. As far as I know there is no way to determine (yet) whether an element is the first on a new page/column, right?

Greetings,
John
mikeday
No, not yet. It's a bit complicated to do. :)
pjrm
I'm having difficulty understanding the situation where this formatting occurs; the sort of content that I most commonly work with doesn't change text-indent according to where the page/column breaks happen to fall. Can you give the ISBN (and a chapter/section reference if necessary) of a book that does this?

Btw, the reason there isn't currently a CSS selector for when something happens to fall at the start of the page or column is that changing the text-indent can change whether or not it is at the start of the page, e.g. due to widow constraints.
John
Hello pjrm,

thanks for your answer. I hope a link to a PDF document is fine as well. Please take a look at the global competitiveness report: http://www3.weforum.org/docs/WEF_GlobalCompetitivenessReport_2014-15.pdf, e.g. page 27.

There you can see how the paragraph, which starts at the top of the second column (first element in this column) is not indented.

Of course it is not mandatory to omit the indent, but occurs often and we are regularly asked by clients whether we support this.

John

dauwhe
I haven't seen this use case before. In this case, I think of the paragraph indent as a visual indicator of a new paragraph. Without it, it may not be clear if the text at the top of the 2nd column in your example is part of the previous paragraph or not. There's another example on p65 which looks very similar to p27, but I think it is the same para rather than a new para.

Dave
John
Hello Dave,

you are absolutely right. In this case it is not obvious whether the paragraph from the left column continues or a new paragraph starts. I agree with you. However, there's demand by our clients for formatting paragraphs this way and I can hardly argue with them. I just thought that maybe somebody else also has had this problem and found a way around it. Anyway, thanks a lot for your answers and input :)

Greetings,
John
dauwhe
The client is always right.

The client could always know more. :)