I am looking for a solution to improve the formatting of quotes in e-books. In e-books, I use quotes, each of which has content and a source. Here's the HTML & CSS:
.quotation { display: block; text-align: justify; margin: 0.25em 1em 0.25em 1.25em; } .quottext { font-style: italic; } .quotsource { margin: 0 0 0 0.25em; }
<p class="quotation"> <span class="quottext">Lorem Ipsum je demonstrativní výplňový text používaný v tiskařském a knihařském průmyslu. Lorem Ipsum je považováno za standard v této oblasti už od začátku 16. století, kdy dnes neznámý tiskař vzal kusy textu a na jejich základě vytvořil speciální vzorovou knihu.</span> <span class="quotsource">(The Lorem Ipsum Manual, page 6)</span> </p>
I am using CSS now:
.quotation { display: block; text-align: justify; margin: 0.25em 1em 0.25em 1.25em; } .quottext { font-style: italic; } .quotsource { margin: 0 0 0 0.25em; }
The result is as follows:

I would like to limit the line break in the source of the quote, either follow the content (if the source text is short), or make a line break and put the source of the quote in a new line (in the case of the source text, long).
When i use:
white-space: nowrap;
for the source of the quote, the source is placed on the following line, but the line before this is too sparse:

In that case, I would like to achieve this:

I would like to use the same HTML and CSS for all quotes, since I never know the display size of an e-reader. Could you advise if there is a solution with HTML and CSS?
source share