Autor Zpráva
codebreaker
Profil
Dobry den.

situace: mam text ve formatu neco.txt, kde je hodne radku. Na jednom radku je typicky jen jedno slovo. Az na tom poslednim - ten je velmi dlouhy.

otazka: Jak udelat, aby se po kazdem konci radku udelal linebreak a zaroven aby ten posledni radek byl zalomen linebreakem tak, aby nebylo nutne skrolovat doprava za ucelem precteni celeho posledniho radku.

Posilam zdrojovy kod:

<html>
<head>

<link href="https://fonts.googleapis.com/css2?family=Bad+Script&family=Open+Sans:wght@300;400&display=swap" rel="stylesheet">

<style>
pre {
    white-space: pre;
    font-family: 'Open Sans';
    font-weight: 300;
    font-size: 15pt;
    display: block;
    unicode-bidi: embed;
}
</style>
</head>
<body>


<pre>
Skoda
BMW
Ford
This is awesome. I need to create a page break after the end of a line.

And now I am a very long line that unfortunetely does not create a page break and for some reason I continue to the right until the line ends. I would like if the browser would create a page break so that all the text in my paragraph is actually displayed without a need to scrolling to the right. I tried to add the width of the pre element in the style to 100%. But it did not work.
</pre>

</body>
</html>

Prosim o radu. Dekuji.
Trejpa
Profil
codebreaker:
pre { white-space: pre-wrap; }
codebreaker
Profil
Děkuji Trejpo!

Vaše odpověď


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0